-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Avoid type coercion when a dereferenced field is same type #3967
Conversation
@laurachenyu have you got a sample table definition and query that replicates the issue? |
Following test will recreate the issue: DROP TABLE IF EXISTS evolve_test; |
@laurachenyu thanks for your PR! please add a test. We should be able to test this with If not, we could cover this with a product test (like |
@laurachenyu Thanks for fixing this issue! It may be easier to add the suggested testcase here along with other dereference related schema mismatches: https://github.com/prestosql/presto/blob/master/presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveIntegrationSmokeTest.java#L4230 |
Thanks, @phd3. |
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Laura Chen.
|
cb3ed5b
to
4d7380b
Compare
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.
LGTM % a comment about the comment.
Failure is unrelated, tests've been retriggered.
presto-hive/src/test/java/io/prestosql/plugin/hive/TestHiveIntegrationSmokeTest.java
Outdated
Show resolved
Hide resolved
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
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.
It seems that we need a similar fix in HiveCoercionRecordCursor
too. This RecordCursor does not create the coercers correctly (only assumes top level types). The issue is visible for TEXTFILE input format and s3_select_pushdown_enabled
set to true.
The issue is relatively less likely to appear because (1) such a schema evolution itself might be rare and (2) HiveCoercionRecordCursor
is not used for GenericHiveRecordCursor. (GenericHiveRecordCursor
does the coercion for top-level row.) (3) Also, the CSV format does not face this issue because it only deals with VARCHAR.
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.
Could you shorten the commit message as follows or something?
Avoid type coercion when a dereferenced field is same type
@phd3 Let's separate an issue because this PR itself is valuable and actually our environment is facing this type coercion error too.
@laurachenyu My above comment meant a commit e617e50 (not PR title). Could you amend the commit message and do force-push? |
@ebyhr Thanks, just pushed with changed commit message. |
Merged, thanks! |
Got failure 'Unsupported coercion from int to int' because unnecessary type coercion was called when retrieving a dereferenced field without type changes.