Skip to content

Commit

Permalink
Fix drop stl
Browse files Browse the repository at this point in the history
  • Loading branch information
loloxwg committed Dec 26, 2023
1 parent b27324c commit cbc3c62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 11 additions & 5 deletions python/hello_infinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@
def main():
infinity_obj = infinity.connect(REMOTE_HOST)
db = infinity_obj.get_database("default")
db.drop_table("my_table2", if_exists=True)
db.drop_table("my_table", if_exists=True)
table = db.create_table(
"my_table2", {"c1": "integer", "c2": "float"}, None)
for i in range(8):
table.insert(
[{"c1": i, "c2": float(i)}])
"my_table", {"num": "integer", "body": "varchar", "vec": "vector,5,float"}, None)
table.insert(
[{"num": 1, "body": "undesirable, unnecessary, and harmful", "vec": [1.0] * 5}])
table.insert(
[{"num": 2, "body": "publisher=US National Office for Harmful Algal Blooms", "vec": [4.0] * 5}])
table.insert(
[{"num": 3, "body": "in the case of plants, growth and chemical", "vec": [7.0] * 5}])

res = table.output(["*"]).knn("vec", [3.0] * 5, "float", "ip", 2).to_pl()
print(res)


if __name__ == '__main__':
Expand Down
6 changes: 4 additions & 2 deletions test/sql/ddl/drop/test_drop.slt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ DROP TABLE IF EXISTS test_drop;
statement ok
CREATE TABLE test_drop (i INTEGER);

statement ok
INSERT INTO a VALUES (42);

query I
INSERT INTO test_drop VALUES (42);
----

#statement error
#SELECT COUNT(*) FROM a;
Expand All @@ -23,6 +24,7 @@ INSERT INTO a VALUES (42);
query I
SELECT * FROM test_drop;
----
42

statement ok
DROP TABLE test_drop;

0 comments on commit cbc3c62

Please sign in to comment.