Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
loloxwg committed Dec 26, 2023
1 parent 536967a commit 5057481
Show file tree
Hide file tree
Showing 71 changed files with 560 additions and 47 deletions.
16 changes: 5 additions & 11 deletions python/hello_infinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@
def main():
infinity_obj = infinity.connect(REMOTE_HOST)
db = infinity_obj.get_database("default")
db.drop_table("my_table", if_exists=True)
db.drop_table("my_table2", if_exists=True)
table = db.create_table(
"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)
"my_table2", {"c1": "integer", "c2": "float"}, None)
for i in range(8):
table.insert(
[{"c1": i, "c2": float(i)}])


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion src/executor/fragment_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void FragmentBuilder::BuildFragments(PhysicalOperator *phys_op, PlanFragment *cu
break;
}
case PhysicalOperatorType::kFusion:
case PhysicalOperatorType::kMergeParallelAggregate:
case PhysicalOperatorType::kMergeAggregate:
case PhysicalOperatorType::kMergeHash:
case PhysicalOperatorType::kMergeLimit:
case PhysicalOperatorType::kMergeTop:
Expand Down
9 changes: 7 additions & 2 deletions src/executor/operator/physcial_drop_view.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import operator_state;
import physical_operator;
import physical_operator_type;
import load_meta;
import infinity_exception;

export module physical_drop_view;

Expand All @@ -35,15 +36,19 @@ public:
u64 id,
SharedPtr<Vector<LoadMeta>> load_metas)
: PhysicalOperator(PhysicalOperatorType::kDropView, nullptr, nullptr, id, load_metas), schema_name_(Move(schema_name)),
view_name_(Move(view_name)), conflict_type_(conflict_type), output_names_(Move(output_names)),
output_types_(Move(output_types)) {}
view_name_(Move(view_name)), conflict_type_(conflict_type), output_names_(Move(output_names)), output_types_(Move(output_types)) {}

~PhysicalDropView() override = default;

void Init() override;

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_aggregate.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import data_table;
import hash_table;
import base_expression;
import load_meta;
import infinity_exception;

export module physical_aggregate;

Expand Down Expand Up @@ -52,6 +53,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

void GroupByInputTable(const SharedPtr<DataTable> &input_table, SharedPtr<DataTable> &output_table);

void GenerateGroupByResult(const SharedPtr<DataTable> &input_table, SharedPtr<DataTable> &output_table);
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_alter.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import operator_state;
import physical_operator;
import physical_operator_type;
import load_meta;
import infinity_exception;

export module physical_alter;

Expand All @@ -41,6 +42,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_command.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import query_context;
import parser;
import operator_state;
import load_meta;
import infinity_exception;

export module physical_command;

Expand All @@ -43,6 +44,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) override;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const override { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const override { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_create_collection.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import operator_state;
import physical_operator;
import physical_operator_type;
import load_meta;
import infinity_exception;

export module physical_create_collection;

Expand All @@ -43,6 +44,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_create_index.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import physical_operator;
import physical_operator_type;
import index_def;
import load_meta;
import infinity_exception;

export module physical_create_index;

Expand All @@ -32,6 +33,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) override;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

SharedPtr<Vector<String>> GetOutputNames() const override { return output_names_; }

SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const override { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_create_schema.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import physical_operator;
import physical_operator_type;
import index_def;
import load_meta;
import infinity_exception;

export module physical_create_schema;

Expand All @@ -44,6 +45,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
5 changes: 5 additions & 0 deletions src/executor/operator/physical_create_table.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import physical_operator_type;
import index_def;
import table_def;
import load_meta;
import infinity_exception;

export module physical_create_table;

Expand Down Expand Up @@ -54,6 +55,10 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}
inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_create_view.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import physical_operator;
import physical_operator_type;
import index_def;
import load_meta;
import infinity_exception;

export module physical_create_view;

Expand All @@ -43,6 +44,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline const SharedPtr<CreateViewInfo> &bound_select_statement() const { return create_view_info_; };

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_cross_product.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import physical_operator;
import physical_operator_type;
import data_table;
import load_meta;
import infinity_exception;

export module physical_cross_product;

Expand All @@ -38,6 +39,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

SharedPtr<Vector<String>> GetOutputNames() const final;

SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final;
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_delete.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import physical_operator;
import physical_operator_type;
import table_collection_entry;
import load_meta;
import infinity_exception;

export module physical_delete;

Expand All @@ -38,6 +39,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_drop_collection.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import operator_state;
import physical_operator;
import physical_operator_type;
import load_meta;
import infinity_exception;

export module physical_drop_collection;

Expand All @@ -42,6 +43,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_drop_index.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import query_context;
import parser;
import operator_state;
import load_meta;
import infinity_exception;

export module physical_drop_index;

Expand All @@ -47,6 +48,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) override;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const override { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const override { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_drop_schema.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import operator_state;
import physical_operator;
import physical_operator_type;
import load_meta;
import infinity_exception;

export module physical_drop_schema;

Expand All @@ -43,6 +44,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_drop_table.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import operator_state;
import physical_operator;
import physical_operator_type;
import load_meta;
import infinity_exception;

export module physical_drop_table;

Expand All @@ -45,6 +46,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
6 changes: 6 additions & 0 deletions src/executor/operator/physical_dummy_operator.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import operator_state;
import physical_operator;
import physical_operator_type;
import load_meta;
import infinity_exception;

export module physical_dummy_operator;

Expand All @@ -36,6 +37,11 @@ public:

bool Execute(QueryContext *query_context, OperatorState *operator_state) final;

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

inline SharedPtr<Vector<String>> GetOutputNames() const final { return output_names_; }

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }
Expand Down
9 changes: 8 additions & 1 deletion src/executor/operator/physical_dummy_scan.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ import operator_state;
import physical_operator;
import physical_operator_type;
import load_meta;
import infinity_exception;

export module physical_dummy_scan;

namespace infinity {

export class PhysicalDummyScan final : public PhysicalOperator {
public:
explicit PhysicalDummyScan(u64 id, SharedPtr<Vector<LoadMeta>> load_metas) : PhysicalOperator(PhysicalOperatorType::kDummyScan, nullptr, nullptr, id, load_metas) {}
explicit PhysicalDummyScan(u64 id, SharedPtr<Vector<LoadMeta>> load_metas)
: PhysicalOperator(PhysicalOperatorType::kDummyScan, nullptr, nullptr, id, load_metas) {}

~PhysicalDummyScan() override = default;

Expand All @@ -40,6 +42,11 @@ public:

inline SharedPtr<Vector<SharedPtr<DataType>>> GetOutputTypes() const final { return output_types_; }

SizeT TaskletCount() override {
Error<NotImplementException>("TaskletCount not Implement");
return 0;
}

private:
SharedPtr<Vector<String>> output_names_{};
SharedPtr<Vector<SharedPtr<DataType>>> output_types_{};
Expand Down
Loading

0 comments on commit 5057481

Please sign in to comment.