Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add truncate function #2432

Merged
merged 34 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8a02a38
add truncate
kche0169 Jan 7, 2025
10a9abb
add registerfunc
kche0169 Jan 7, 2025
1e7a946
add test cases for truncate
kche0169 Jan 7, 2025
fc6c149
add other support functions file
kche0169 Jan 7, 2025
b1e02ae
add reverse func
kche0169 Jan 7, 2025
1c0cae2
remove useless code about test truncate in test_select.py
kche0169 Jan 7, 2025
b4441f7
remove Unrelated documents
kche0169 Jan 7, 2025
03f1841
success connect the backend and frontend, truncate can be used in the…
kche0169 Jan 8, 2025
7f113d2
add more Error Handings
kche0169 Jan 8, 2025
5217a45
Merge branch 'main' into main
kche0169 Jan 8, 2025
e12bacf
Remove the code commented out
kche0169 Jan 9, 2025
ad10425
add more test cases and change the previous test cases about truncate…
kche0169 Jan 9, 2025
19dac45
add changes in py server to make the database supported trunc function
kche0169 Jan 9, 2025
973a4b4
Merge branch 'main' of github.com:kche0169/infinity
kche0169 Jan 9, 2025
020c773
remove commented code
kche0169 Jan 9, 2025
1579efc
remove changes in test file
kche0169 Jan 9, 2025
b14d2a6
change license information and remove std::cout
kche0169 Jan 9, 2025
655ca81
remove include files, add functions supported float types and more fu…
kche0169 Jan 9, 2025
bbfc406
add two unit tests
kche0169 Jan 9, 2025
b4ad5ca
change the order of the import statements in truncate_functions.cpp
kche0169 Jan 9, 2025
956c4e7
remove useless functions
kche0169 Jan 9, 2025
3f35608
remove useless include files
kche0169 Jan 9, 2025
62d206b
remove useless include files
kche0169 Jan 9, 2025
8566bd0
remove useless include files
kche0169 Jan 9, 2025
aef0e6a
Merge branch 'infiniflow:main' into main
kche0169 Jan 10, 2025
2432705
The implementation form has been modified to complete the function mo…
kche0169 Jan 10, 2025
6fc0d4d
-remove useless include file
kche0169 Jan 10, 2025
4dab966
Delete python/test_pysdk/launch.json
kche0169 Jan 10, 2025
067639b
fix out of range
kche0169 Jan 10, 2025
77a39e8
Merge branch 'main' of github.com:kche0169/infinity
kche0169 Jan 10, 2025
ffd9698
remove empty line
kche0169 Jan 10, 2025
8b17ed0
ingnore the truncate unite test to fix bug
kche0169 Jan 11, 2025
1157de6
fix bugs
kche0169 Jan 11, 2025
fb5b548
Optimized the code
kche0169 Jan 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/infinity_embedded/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def binary_exp_to_paser_exp(binary_expr_key) -> str:
elif binary_expr_key == "mod":
return "%"
else:
raise InfinityException(ErrorCode.INVALID_EXPRESSION, f"unknown binary expression: {binary_expr_key}")
# raise InfinityException(ErrorCode.INVALID_EXPRESSION, f"unknown binary expression: {binary_expr_key}")
JinHai-CN marked this conversation as resolved.
Show resolved Hide resolved
return binary_expr_key


def deprecated_api(message):
Expand Down
3 changes: 2 additions & 1 deletion python/infinity_sdk/infinity/remote_thrift/query_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ def output(self, columns: Optional[list]) -> InfinityThriftQueryBuilder:
parsed_expr = ParsedExpr(type=expr_type)
select_list.append(parsed_expr)
case _:
select_list.append(parse_expr(maybe_parse(column)))
expr = maybe_parse(column)
select_list.append(parse_expr(expr))

self._columns = select_list
return self
Expand Down
14 changes: 14 additions & 0 deletions python/infinity_sdk/infinity/remote_thrift/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,20 @@ def traverse_conditions(cons, fn=None) -> ttypes.ParsedExpr:
parsed_expr = ttypes.ParsedExpr(type=expr_type)
return parsed_expr
# in
elif isinstance(cons, exp.Command):
func_name = cons.args['this']
arguments = []
for arg in cons.args['expression']:
if arg:
arguments.append(parse_expr(arg))

func_expr = ttypes.FunctionExpr(
function_name=func_name,
arguments=arguments
)
expr_type = ttypes.ParsedExprType(function_expr=func_expr)
parsed_expr = ttypes.ParsedExpr(type=expr_type)
return parsed_expr
elif isinstance(cons, exp.In):
left_operand = parse_expr(cons.args['this'])
arguments = []
Expand Down
5 changes: 3 additions & 2 deletions tools/run_pysdk_remote_infinity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
python_executable = sys.executable


def python_sdk_test(python_test_dir: str, pytest_mark: str):
def python_sdk_test(python_test_dir: str, pytest_mark: str, single_file_name=""):
JinHai-CN marked this conversation as resolved.
Show resolved Hide resolved
# The single file name must be start with '/'
print("python test path is {}".format(python_test_dir))
# run test
print(f"start pysdk test with {pytest_mark}")
Expand All @@ -22,7 +23,7 @@ def python_sdk_test(python_test_dir: str, pytest_mark: str):
"-x",
"-m",
pytest_mark,
f"{python_test_dir}/test_pysdk",
f"{python_test_dir}/test_pysdk" + single_file_name,
]
quoted_args = ['"' + arg + '"' if " " in arg else arg for arg in args]
print(" ".join(quoted_args))
Expand Down