-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: Use NativeType in get_example_type, information schema #21737
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
Open
theirix
wants to merge
21
commits into
apache:main
Choose a base branch
from
theirix:type-signature-native-type
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
2d47696
Use NativeType in get_example_types and information schema
theirix 179f794
Apply suggestions from code review
theirix a22c2f6
Use of Decimals
theirix c54da40
Refactor get_data_type_for_schema to return result
theirix 50b6858
Remove old deprecated get_possible_types
theirix 5276933
Avoid breaking get_example_types API
theirix 840fbb9
Fix docs
theirix 42ee8ee
Merge branch 'main' into type-signature-native-type
theirix 687fa6a
Reuse LogicalType type mapping
theirix 3d1b43a
Format
theirix 123bec2
Merge branch 'main' into type-signature-native-type
theirix 6997029
Sync test cases with main
theirix 7fff35a
Avoid dedup with arg sorting
theirix 736e56d
Resolve ambigious native-to-physical types
theirix 082df11
Test ambigious cases
theirix 0c8e779
Avoid committing parquet-testing
theirix f8a88d9
Typos
theirix b723695
Handle types missing from default_cast_for
theirix 305c36d
Coerce deduced return types
theirix af0662a
SLT: date_trunc announces Timestamp return type
theirix 91efce9
SLT: verify generate_series returning Date
theirix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
generate_series/rangenow report only(String, Date, Interval) → List(String), but the query returnsList(Date32). Base also listedList(Date), but only because itsDate64example happened to hit(_, Some(Date64))inRange::return_type. That match is lost now thatDateresolves only toDate32. The underlying cause predates this PR: the return type is computed on arguments that haven't been coerced, which theget_representative_typesdocs say callers must do. Fine to handle in a follow-up.Fix: coerce the arguments the same way the planner does before asking for the return type. I tried this locally: it fixes this row and also corrects
sum(Int32)(NULL→Int64),trunc(Int64)(NULL→Float64),median(Int64)(Int64→Float64) anddate_trunc(String, Date)(Date→Timestamp(ns)), all checked againstarrow_typeof. It does change the existingdate_truncexpectations ininformation_schema.slt.use datafusion_expr::function::WindowUDFFieldArgs; +use datafusion_expr::type_coercion::functions::fields_with_udf;get_args_and_return_types(udf.signature(), |arg_fields| { + let arg_fields = &fields_with_udf(arg_fields, udf.as_ref())?; let scalar_arguments = &vec![None; arg_fields.len()];get_args_and_return_types(udaf.signature(), |arg_fields| { - udaf.return_field(arg_fields) + udaf.return_field(&fields_with_udf(arg_fields, udaf.as_ref())?) })get_args_and_return_types(udwf.signature(), |arg_fields| { + let arg_fields = &fields_with_udf(arg_fields, udwf.as_ref())?; udwf.field(WindowUDFFieldArgs::new(arg_fields, udwf.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.
Added, tests are updated to check
date_truncand a newgenerate_seriescase