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

[FLINK-13112][table-planner-blink] Support LocalZonedTimestampType in blink #9036

Closed
wants to merge 2 commits into from

Conversation

JingsongLi
Copy link
Contributor

@JingsongLi JingsongLi commented Jul 9, 2019

What is the purpose of the change

Now we just support TimestampType, it is without time zone.
We need support LocalZonedTimestampType, and define time zone in config.

Now, for the functions of TIMESTAMP_WITH_LOCAL_TIME_ZONE:
1.cast: only support cast to and cast from Char/VarChar/Date/Time/Timestamp. (Limitation of calcite)
2.Support calcite functions: EXTRACT, FLOOR, CEIL, UNIX_TIMESTAMP, DATE_FORMAT.
3.Not support functions of blink extension.

Verifying this change

ut

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no

@flinkbot
Copy link
Collaborator

flinkbot commented Jul 9, 2019

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 1f7eaf1 (Tue Aug 06 15:40:05 UTC 2019)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The 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 commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Jul 9, 2019

CI report for commit de3f751: FAILURE Build

*/
private TimeZone timeZone = TimeZone.getTimeZone("UTC");
private ZoneId zoneId = ZoneId.systemDefault();
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this break the old behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This never be used in release-1.8.

Copy link
Contributor

@KurtYoung KurtYoung Jul 10, 2019

Choose a reason for hiding this comment

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

Another concern is it may cause unstable tests if systemDefault is based on some system level settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In theory, tests should pass always, if the test not set zone id, the assert should not expect some time zone dependents.

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 bad experience with time zone set to "UTC" by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TimestampWithLocalTimeZone will be same to TimestampWithoutZone if we set to "UTC" by default.
I take a look to hive, spark, they all are default system time zone by default. Oracle maybe same.
I think user want to default system time zone when use TimestampWithLocalTimeZone at the most of the time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll change to getLocalTimeZone

@flinkbot
Copy link
Collaborator

CI report for commit 5685400: FAILURE Build

@flinkbot
Copy link
Collaborator

CI report for commit 84e511a: FAILURE Build

@flinkbot
Copy link
Collaborator

CI report for commit a684ed1: FAILURE Build

@JingsongLi JingsongLi force-pushed the localZoneBack branch 2 times, most recently from 1abd1e5 to cf2afbf Compare July 11, 2019 05:42
*/
private TimeZone timeZone = TimeZone.getTimeZone("UTC");
private ZoneId localZoneId = ZoneId.systemDefault();
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @twalthr, we changed TimeZone to LocalZoneId to better fit with TIMESTAMP WITH LOCAL TIME ZONE

@flinkbot
Copy link
Collaborator

flinkbot commented Jul 11, 2019

CI report:

@KurtYoung
Copy link
Contributor

LGTM, @twalthr , do you have further comments?

@JingsongLi
Copy link
Contributor Author

/**
* Adds a reusable Time ZoneId to the member area of the generated class.
*/
def addReusableTimeZoneID(): String = {
Copy link
Member

@wuchong wuchong Jul 11, 2019

Choose a reason for hiding this comment

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

Nit: Never used. Remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I think it should be used, we now use old time zone, we should use zone id instead.

@KurtYoung
Copy link
Contributor

@KurtYoung
Copy link
Contributor

Merging this..

@KurtYoung KurtYoung closed this in f617ad8 Jul 11, 2019
@JingsongLi JingsongLi deleted the localZoneBack branch January 14, 2020 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants