Skip to content

Commit

Permalink
Remove redundant code (#1396)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Some third_party library isn't necessary any more.

### Type of change

- [x] Refactoring

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
  • Loading branch information
JinHai-CN authored Jun 26, 2024
1 parent d77e408 commit eafca96
Show file tree
Hide file tree
Showing 69 changed files with 67 additions and 33,615 deletions.
67 changes: 67 additions & 0 deletions example/sparse_vector_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright(C) 2023 InfiniFlow, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

'''
This example is to connect local infinity instance, create table, insert data, search the data
'''

import infinity

try:
# open a local directory to store the data
infinity_instance = infinity.connect("/var/infinity")

# connect to server with 127.0.0.1
# infinity_instance = infinity.connect(infinity.common.LOCAL_HOST)

# 'default_db' is the default database
db_instance = infinity_instance.get_database("default_db")

# Drop my_table if it already exists
db_instance.drop_table("my_table", infinity.common.ConflictType.Ignore)

# Create a table named "my_table"
table_instance = db_instance.create_table("my_table", {
"num": {"type": "integer"},
"body": {"type": "varchar"},
"vec": {"type": "sparse,100,float,int"}
})

# Insert 3 rows of data into the 'my_table'
table_instance.insert(
[
{
"num": 1,
"body": r"unnecessary and harmful",
"vec": {"indices": [10, 20, 30], "values": [1.1, 2.2, 3.3]}
},
{
"num": 2,
"body": r"Office for Harmful Blooms",
"vec": {"indices": [40, 50, 60], "values": [4.4, 5.5, 6.6]}
},
{
"num": 3,
"body": r"A Bloom filter is a space-efficient probabilistic data structure, conceived by Burton Howard Bloom in 1970, that is used to test whether an element is a member of a set.",
"vec": {"indices": [70, 80, 90], "values": [7.7, 8.8, 9.9]}
},
]
)

result = table_instance.output(["num", "vec", "_similarity"]).match_sparse("vec", {"indices": [0, 20, 80], "values": [1.0, 2.0, 3.0]}, "ip", 3).to_pl()
print(result)
infinity_instance.disconnect()

except Exception as e:
print(str(e))
3 changes: 0 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ target_link_libraries(infinity
sql_parser
onnxruntime_mlas
zsv_parser
roaring
newpfor
fastpfor
thrift.a
Expand Down Expand Up @@ -331,7 +330,6 @@ target_link_libraries(embedded_infinity_ext PRIVATE
sql_parser
onnxruntime_mlas
zsv_parser
roaring
newpfor
fastpfor
lz4.a
Expand Down Expand Up @@ -459,7 +457,6 @@ target_link_libraries(unit_test
infinity_core
onnxruntime_mlas
zsv_parser
roaring
newpfor
fastpfor
lz4.a
Expand Down
9 changes: 0 additions & 9 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ add_subdirectory(magic_enum)
# Build spdlog
add_subdirectory(spdlog)

set(TLSF_DIR tlsf)
add_library(
tlsf
${TLSF_DIR}/tlsf.cpp
)

# Build roaring
add_subdirectory(croaring)

# Build mlas
add_subdirectory(mlas)

Expand Down
15 changes: 0 additions & 15 deletions third_party/croaring/AUTHORS

This file was deleted.

34 changes: 0 additions & 34 deletions third_party/croaring/CMakeLists.txt

This file was deleted.

236 changes: 0 additions & 236 deletions third_party/croaring/LICENSE

This file was deleted.

Loading

0 comments on commit eafca96

Please sign in to comment.