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

exposed function to merge tdigest with small refactoring #6

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

thobai
Copy link
Collaborator

@thobai thobai commented Nov 18, 2024

same as in the closed PR, but with small refactoring

let file = Cursor::new(&td_json);
let df = JsonReader::new(file)
.with_json_format(JsonFormat::JsonLines)
.infer_schema_len(Some(3))
Copy link
Contributor

Choose a reason for hiding this comment

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

We know the schema beforehand, so there is no need to infer it. We already have .with_schema(Arc::new(Schema::from_iter(tdigest_fields()))) in another place. Also I faced the problem that infer_schema doesn't work if the input is empty

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch. I replaced this in both places where we had still used this

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, then LGTM

@thobai thobai merged commit 40da1a3 into main Nov 21, 2024
11 checks passed
@thobai thobai deleted the merge-tdigest branch November 21, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants