-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-16847][python] Support timestamp types in vectorized Python UDF #11556
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
Conversation
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 5236963 (Sun Mar 29 06:00:43 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. DetailsThe Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
hequn8128
left a comment
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.
@dianfu Thanks a lot for the PR. The code looks very good. Only a few suggestions below.
| PyFlinkBlinkStreamTableTestCase): | ||
| pass | ||
|
|
||
| def test_data_types_only_supported_in_blink_planner(self): |
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.
Extract this test_data_types_only_supported_in_blink_planner into a class and make the BlinkStreamPandasUDFITTests and BlinkBatchPandasUDFITTests extending from this class.
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.
Good idea. +1
| assert isinstance(timestamp_param[0], datetime.datetime), \ | ||
| 'timestamp_param of wrong type %s !' % type(timestamp_param[0]) | ||
| assert timestamp_param[0] == timestamp_value, \ | ||
| 'timestamp_param is wrong value %s, %s!' % (timestamp_param[0], timestamp_value) |
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.
How about "timestamp_param is wrong value %s, should be %s!"
flink-python/pyflink/table/types.py
Outdated
| return pa.time64('us') | ||
| else: | ||
| return pa.time64('ns') | ||
| elif type(data_type) == LocalZonedTimestampType or type(data_type) == TimestampType: |
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.
Maybe type(data_type) in [LocalZonedTimestampType, TimestampType]:
5236963 to
475f1db
Compare
|
@hequn8128 Thanks a lot for the review. The comments make sense to me and have updated the PR according to the comments. |
|
@dianfu Thanks a lot for the update. LGTM. Merging... |
What is the purpose of the change
This pull request adds support of LocalZonedTimestampType and TimestampType in vectorized Python UDF.
Brief change log
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation