You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/10 08:16:28 UTC
[GitHub] [spark] MaxGekk opened a new pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
MaxGekk opened a new pull request #32120:
URL: https://github.com/apache/spark/pull/32120
### What changes were proposed in this pull request?
1. Extend `IntervalUtils` methods: `toYearMonthIntervalString` and `toDayTimeIntervalString` to support formatting of year-month/day-time intervals in Hive style. The methods get new parameter style which can have to values; `HIVE_STYLE` and `ANSI_STYLE`.
2. Invoke `toYearMonthIntervalString` and `toDayTimeIntervalString` from the `Cast` expression with the `style` parameter is set to `ANSI_STYLE`.
3. Invoke `toYearMonthIntervalString` and `toDayTimeIntervalString` from `HiveResult` with `style` is set to `HIVE_STYLE`.
### Why are the changes needed?
The `spark-sql` shell formats its output in Hive style by using `HiveResult.hiveResultString()`. The changes are needed to match Hive behavior. For instance,
Hive:
```sql
0: jdbc:hive2://localhost:10000/default> select timestamp'2021-01-01 01:02:03.000001' - date'2020-12-31';
+-----------------------+
| _c0 |
+-----------------------+
| 1 01:02:03.000001000 |
+-----------------------+
```
Spark before the changes:
```sql
spark-sql> select timestamp'2021-01-01 01:02:03.000001' - date'2020-12-31';
INTERVAL '1 01:02:03.000001' DAY TO SECOND
```
### Does this PR introduce _any_ user-facing change?
Yes. After the changes:
```sql
spark-sql> select timestamp'2021-01-01 01:02:03.000001' - date'2020-12-31';
1 01:02:03.000001000
```
### How was this patch tested?
1. Added new tests to `IntervalUtilsSuite`:
```
$ build/sbt "test:testOnly *IntervalUtilsSuite"
```
2. Modified existing tests in `HiveResultSuite`:
```
$ build/sbt -Phive-2.3 -Phive-thriftserver "testOnly *HiveResultSuite"
```
3. By running cast tests:
```
$ build/sbt "testOnly *CastSuite*"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817099609
**[Test build #137165 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137165/testReport)** for PR 32120 at commit [`3daaf3d`](https://github.com/apache/spark/commit/3daaf3d0581318ccfdf1609ff7542597807023aa).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817104647
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41744/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817144248
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137165/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817144248
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137165/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817105145
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41744/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817106458
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41744/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817099609
**[Test build #137165 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137165/testReport)** for PR 32120 at commit [`3daaf3d`](https://github.com/apache/spark/commit/3daaf3d0581318ccfdf1609ff7542597807023aa).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk closed pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #32120:
URL: https://github.com/apache/spark/pull/32120
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817261809
Merging to master. Thank you @yaooqinn and @HyukjinKwon for your review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817106458
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41744/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #32120: [SPARK-35016][SQL] Format ANSI intervals in Hive style
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32120:
URL: https://github.com/apache/spark/pull/32120#issuecomment-817138057
**[Test build #137165 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137165/testReport)** for PR 32120 at commit [`3daaf3d`](https://github.com/apache/spark/commit/3daaf3d0581318ccfdf1609ff7542597807023aa).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org