Skip to content

[SPARK-31892][SQL][FOLLOWUP][test-java11] Improve test coverage for datetime pattern with formatter functions #28718

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

Closed
wants to merge 11 commits into from

Conversation

yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented Jun 3, 2020

What changes were proposed in this pull request?

This PR is a followup for #28706, we want fully check for the formatter, which can warn us ahead if there is any behavior change when we update JDK.

Why are the changes needed?

test coverage and hotfix for the silly mistake in #28706 at https://github.com/apache/spark/pull/28718/files#diff-7f589e01d3e5e5ea284c1622527d4984R49

Does this PR introduce any user-facing change?

NO

How was this patch tested?

add tests

-- !query schema
struct<date_format(t, VV z zz zzz zzzz O OOOO X XX XXX XXXX XXXXX x xx xxx xxxx xxxx xxxxx Z ZZ ZZZ ZZZZ ZZZZZ):string>
-- !query output
America/Los_Angeles PST PST PST Pacific Standard Time GMT-7:52:58 GMT-07:52:58 -0752 -0752 -07:52 -075258 -07:52:58 -0752 -0752 -07:52 -075258 -075258 -07:52:58 -0752 -0752 -0752 GMT-07:52:58 -07:52:58
Copy link
Member Author

Choose a reason for hiding this comment

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

Do you know what causes this inaccuracy for dates before 1582-10-15?@cloud-fan

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems to only display the value of spark.sql.session.timeZone

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, this is expected. The Spark test uses timezone America/Los_Angeles, which is indeed GMT-7:52:58 long time before, see https://www.politico.com/story/2017/11/18/railroads-initiative-synchronizes-us-clocks-nov-18-1883-244935

Spark's timestamp value doesn't have an associated timezone, so extracting timezone means showing the session local timezone.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123479 has finished for PR 28718 at commit 6449e08.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123476 has finished for PR 28718 at commit 7e59d65.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123487 has finished for PR 28718 at commit 47d7322.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123480 has finished for PR 28718 at commit de63621.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123482 has finished for PR 28718 at commit 3fea4de.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123490 has finished for PR 28718 at commit 83499a1.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123486 has finished for PR 28718 at commit 34aef79.

  • This patch passes all tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@yaooqinn yaooqinn changed the title [SPARK-31892][SQL][FOLLOWUP] Improve test coverage for valid pattern … [SPARK-31892][SQL][FOLLOWUP] Improve test coverage for datetime pattern with formatter functions Jun 3, 2020
@@ -0,0 +1,36 @@
--- TESTS FOR DATETIME FORMATTING FUNCTIONS WITH INVALID PATTERNS ---

-- separating this from datetime-formatting.sql ,because the text form
Copy link
Contributor

Choose a reason for hiding this comment

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

.sql ,because -> .sql, because

select date_format('2018-11-17 13:33:33.333', 'EEEEE');
select date_format('2018-11-17 13:33:33.333', 'FF');
select date_format('2018-11-17 13:33:33.333', 'ddd');
-- DD is invalid in 8, but valid in 11 for the JDKs that PR builder uses
Copy link
Contributor

Choose a reason for hiding this comment

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

DD is invalid if the day-of-year exceeds 100, but it becomes valid in Java 11.


select col, date_format(col, 'S SS SSS SSSS SSSSS SSSSSS SSSSSSS SSSSSSSS SSSSSSSSS') from v;

-- add upper function here to avoid
Copy link
Contributor

Choose a reason for hiding this comment

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

to avoid what?

@cloud-fan
Copy link
Contributor

@dongjoon-hyun do you know how to trigger java 11 test in the PR builder?

@MaxGekk
Copy link
Member

MaxGekk commented Jun 3, 2020

@cloud-fan See the example #28463 - add [test-java11]

@cloud-fan cloud-fan changed the title [SPARK-31892][SQL][FOLLOWUP] Improve test coverage for datetime pattern with formatter functions [SPARK-31892][SQL][FOLLOWUP][[test-java11]] Improve test coverage for datetime pattern with formatter functions Jun 3, 2020
@cloud-fan cloud-fan changed the title [SPARK-31892][SQL][FOLLOWUP][[test-java11]] Improve test coverage for datetime pattern with formatter functions [SPARK-31892][SQL][FOLLOWUP][test-java11] Improve test coverage for datetime pattern with formatter functions Jun 3, 2020
@cloud-fan
Copy link
Contributor

retest this please

@dongjoon-hyun
Copy link
Member

Sorry for being late. Yes, @MaxGekk 's comment is correct.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123488 has finished for PR 28718 at commit 1e78a4e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123491 has finished for PR 28718 at commit 4d34f44.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123498 has finished for PR 28718 at commit eeceba5.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123494 has finished for PR 28718 at commit eeceba5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2020

Test build #123493 has finished for PR 28718 at commit 11c9653.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yaooqinn yaooqinn closed this Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants