-
Notifications
You must be signed in to change notification settings - Fork 284
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
base: main
Are you sure you want to change the base?
Add truncate function #2432
Conversation
… in the test_select file
@@ -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=""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why update this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remove this change
src/function/scalar/truncate.cpp
Outdated
#include <cstddef> | ||
#include <cmath> | ||
#include <iostream> | ||
#include <sstream> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why some many headers need to include?
@@ -0,0 +1,63 @@ | |||
// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2023->2025
src/function/scalar/truncate.cpp
Outdated
@@ -0,0 +1,77 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apache license information
src/function/scalar/truncate.cpp
Outdated
} else { | ||
|
||
truncated_str = str.substr(0, i + right + 1); | ||
std::cout << truncated_str << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why std::cout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove it
import logical_type; | ||
import internal_types; | ||
import data_type; | ||
#if 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ignore the unit test?
python/test_pysdk/test_select.py
Outdated
db_obj = self.infinity_obj.get_database("default_db") | ||
db_obj.drop_table("test_select_truncate" + suffix, ConflictType.Ignore) | ||
db_obj.create_table("test_select_truncate" + suffix, | ||
{"c": {"type": "double"}}, ConflictType.Error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to check 'float' type data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
…nction tests, the unit tests are remaining to be added.
What problem does this PR solve?
add truncate function
Type of change