Skip to content

Conversation

@AngersZhuuuu
Copy link
Contributor

@AngersZhuuuu AngersZhuuuu commented May 5, 2021

What changes were proposed in this pull request?

Rename pattern strings and regexps of year-month and day-time intervals.

Why are the changes needed?

To improve code maintainability.

Does this PR introduce any user-facing change?

No

How was this patch tested?

By existing test suites.

@AngersZhuuuu
Copy link
Contributor Author

FYI @MaxGekk

@github-actions github-actions bot added the SQL label May 5, 2021
@SparkQA
Copy link

SparkQA commented May 5, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42698/

@SparkQA
Copy link

SparkQA commented May 5, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42698/

@SparkQA
Copy link

SparkQA commented May 5, 2021

Test build #138177 has finished for PR 32444 at commit 09a7479.

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

@AngersZhuuuu AngersZhuuuu changed the title [SPARK-35111][SQL][FOLLOWUP] Support Cast string to year-month interval [SPARK-35111][SPARK-35112][SQL][FOLLOWUP] Support Cast string to year-month interval May 7, 2021
private val yearMonthStringPattern =
"(?i)^(INTERVAL\\s+)([+|-])?(')([+|-])?(\\d+)-(\\d+)(')(\\s+YEAR\\s+TO\\s+MONTH)$".r
private val unquotedYearMonthRegex = "([+|-])?(\\d+)-(\\d+)".r
private val quotedYearMonthPattern = (s"^$unquotedYearMonthRegex$$").r
Copy link
Contributor

@cloud-fan cloud-fan May 7, 2021

Choose a reason for hiding this comment

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

I don't really see what "quoted" means 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.

I don't really see what "quoted" means here...

he may want to mean it without ^ and $

Copy link
Contributor

Choose a reason for hiding this comment

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

that's not quoted. To me it's more like regex string vs compiled regex.

How about yearMonthPatternString, yearMonthRegex and yearMontnLiteralRegex?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Look good, done

@SparkQA
Copy link

SparkQA commented May 7, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42774/

@SparkQA
Copy link

SparkQA commented May 7, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42774/

@SparkQA
Copy link

SparkQA commented May 7, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42776/

@SparkQA
Copy link

SparkQA commented May 7, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42776/

@SparkQA
Copy link

SparkQA commented May 7, 2021

Test build #138252 has finished for PR 32444 at commit 915ddaf.

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

@SparkQA
Copy link

SparkQA commented May 7, 2021

Test build #138254 has finished for PR 32444 at commit 3e7fb54.

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

@SparkQA
Copy link

SparkQA commented May 8, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42796/

@SparkQA
Copy link

SparkQA commented May 8, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42796/

@SparkQA
Copy link

SparkQA commented May 8, 2021

Test build #138274 has finished for PR 32444 at commit 8569d86.

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

@MaxGekk MaxGekk changed the title [SPARK-35111][SPARK-35112][SQL][FOLLOWUP] Support Cast string to year-month interval [SPARK-35111][SPARK-35112][SQL][FOLLOWUP] Rename ANSI interval patterns and regexps May 10, 2021
@MaxGekk
Copy link
Member

MaxGekk commented May 10, 2021

+1, LGTM. Merging to master.
Thank you, @AngersZhuuuu and @cloud-fan for your review.

@MaxGekk MaxGekk closed this in 2c8ced9 May 10, 2021
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.

4 participants