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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Add truncate function #2432

wants to merge 25 commits into from

Conversation

kche0169
Copy link

@kche0169 kche0169 commented Jan 7, 2025

What problem does this PR solve?

add truncate function

Type of change

  • New Feature (non-breaking change which adds functionality)

@small-turtle-1 small-turtle-1 added the ci PR can be test label Jan 7, 2025
@@ -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=""):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why update this file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove this change

@yingfeng yingfeng changed the title add truncate function Add truncate function Jan 9, 2025
#include <cstddef>
#include <cmath>
#include <iostream>
#include <sstream>
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2023->2025

@@ -0,0 +1,77 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apache license information

} else {

truncated_str = str.substr(0, i + right + 1);
std::cout << truncated_str << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why std::cout?

Copy link
Author

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
Copy link
Contributor

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?

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)
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

@kche0169 kche0169 added the wip work in progress label Jan 9, 2025
@kche0169 kche0169 removed the wip work in progress label Jan 9, 2025
@kche0169 kche0169 added wip work in progress bug Something isn't working labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci PR can be test wip work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants