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

[HUDI-7303] Fix date field type unexpectedly convert to Long when usi… #10517

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

paul8263
Copy link
Contributor

…ng date comparison operator.

Change Logs

When using between, less than (less than or equal) or greater than (greater than or equal) operators with field typed of date, the date type will unexpected convert to Long, which is incompatible with its primitive type INT32.

Impact

No impact.

Risk level (write none, low medium or high below)

Low risk level.

Documentation Update

No need to update the documentation.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

case TIME_WITHOUT_TIME_ZONE:
return predicateSupportsLtGt(functionDefinition, intColumn(columnName), (Integer) literal);
case BIGINT:
case DATE:
case TIMESTAMP_WITHOUT_TIME_ZONE:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any exception thrown here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @danny0405 ,

As far as I could see there should be no exceptions thrown here. I have gone through all TPCDS queries. They could work well with all patches applied that I sumbitted recently.

If there might be some potential risks for this change, please let me know. Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then why we need this fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @danny0405 ,

Please see: HUDI-7303.

In parquet, date type is stored as INT32 (epoch day). But if we add some conditions with date typed field in SQL where clause, its type will unexpectedly convert to Long.

@danny0405
Copy link
Contributor

There are test failures:

[ERROR] Errors: 
[ERROR]   TestHoodieTableSource.testBucketPruningSpecialKeyDataType:267 » ClassCast java...
[ERROR]   TestHoodieTableSource.testBucketPruningSpecialKeyDataType:267 » ClassCast java...

@paul8263
Copy link
Contributor Author

There are test failures:

[ERROR] Errors: 
[ERROR]   TestHoodieTableSource.testBucketPruningSpecialKeyDataType:267 » ClassCast java...
[ERROR]   TestHoodieTableSource.testBucketPruningSpecialKeyDataType:267 » ClassCast java...

Err... I could not find exceptions in CI check reports. Could you please help me about the detailed error stacktrace? Thanks.

@hudi-bot
Copy link

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@danny0405 danny0405 added flink Issues related to flink schema-and-data-types labels Jan 23, 2024
@danny0405 danny0405 merged commit f5133e1 into apache:master Jan 23, 2024
31 checks passed
yihua pushed a commit that referenced this pull request Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flink Issues related to flink schema-and-data-types
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants