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/08/06 09:15:25 UTC
[GitHub] [spark] gengliangwang opened a new pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
gengliangwang opened a new pull request #33666:
URL: https://github.com/apache/spark/pull/33666
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'core/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
Implement a new rule for the date-time operations in the ANSI type coercion system:
1. Date will be converted to Timestamp when it is in the subtraction with Timestmap.
2. Promote string literals in date_add/date_sub/time_add
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
Currently the type coercion rule `DateTimeOperations` doesn't match the design of the ANSI type coercion system:
1. For date_add/date_sub, if the input is timestamp type, Spark should not convert it into date type since date type is narrower than the timestamp type.
2. For date_add/date_sub/time_add, string value can be implicit cast to date/timestamp only when it is literal.
Thus, we need to have a new rule for the date-time operations in the ANSI type coercion system.
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
No, the ANSI type coercion rules are not releaesd.
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->
New UT
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894402725
**[Test build #142160 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142160/testReport)** for PR 33666 at commit [`653d0c6`](https://github.com/apache/spark/commit/653d0c6cb31fda012df85bcf4eeb795f0a628469).
* 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang commented on pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-896479027
Merging to master/3.2
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895395003
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46741/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894514721
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142168/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895315535
**[Test build #142230 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142230/testReport)** for PR 33666 at commit [`d8e468f`](https://github.com/apache/spark/commit/d8e468f730dc18fb8d7445866991dcf63de5e9b6).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895467355
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142230/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894487507
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46681/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-896011567
**[Test build #142262 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142262/testReport)** for PR 33666 at commit [`eb0b080`](https://github.com/apache/spark/commit/eb0b0800461eaa3e0684a212e27d1300bf6b9024).
* 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang closed pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang closed pull request #33666:
URL: https://github.com/apache/spark/pull/33666
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894126380
**[Test build #142155 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142155/testReport)** for PR 33666 at commit [`21391c4`](https://github.com/apache/spark/commit/21391c45682642eb9ae5f9a4fc77345149733ff2).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r684305171
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AnsiTypeCoercion.scala
##########
@@ -289,6 +289,13 @@ object AnsiTypeCoercion extends TypeCoercionBase {
case other => other
}
p.makeCopy(Array(a, newList))
+
+ case d @ DateAdd(left @ StringType(), _) if left.foldable =>
Review comment:
Well, DateAdd is a sort of arithmetic expression
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895822349
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r684288897
##########
File path: sql/core/src/test/resources/sql-tests/inputs/date.sql
##########
@@ -91,6 +91,11 @@ create temp view v as select '1' str;
select date_add('2011-11-11', str) from v;
select date_sub('2011-11-11', str) from v;
+-- non-literal string column add/sub with integer
+create or replace temp view v2 as select '2011-11-11' str;
Review comment:
nit: let's remove `or replace`. It's always error-prone if we replace a temp view in the test, as we may change the rest of the test cases.
##########
File path: sql/core/src/test/resources/sql-tests/inputs/timestamp.sql
##########
@@ -102,6 +102,8 @@ select timestamp'2011-11-11 11:11:11' - interval '2' second;
select '2011-11-11 11:11:11' - interval '2' second;
select '1' - interval '2' second;
select 1 - interval '2' second;
+create or replace temp view v as select '2011-11-11' str;
Review comment:
ditto
##########
File path: sql/core/src/test/resources/sql-tests/inputs/timestamp.sql
##########
@@ -102,6 +102,8 @@ select timestamp'2011-11-11 11:11:11' - interval '2' second;
select '2011-11-11 11:11:11' - interval '2' second;
select '1' - interval '2' second;
select 1 - interval '2' second;
+create or replace temp view v as select '2011-11-11' str;
+select str - interval '2' second from v;
Review comment:
-- non-literal string column subtract interval
##########
File path: sql/core/src/test/resources/sql-tests/inputs/timestamp.sql
##########
@@ -102,6 +102,8 @@ select timestamp'2011-11-11 11:11:11' - interval '2' second;
select '2011-11-11 11:11:11' - interval '2' second;
select '1' - interval '2' second;
select 1 - interval '2' second;
+create or replace temp view v as select '2011-11-11' str;
+select str - interval '2' second from v;
Review comment:
-- non-literal string column subtract interval
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r684325413
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AnsiTypeCoercion.scala
##########
@@ -289,6 +289,13 @@ object AnsiTypeCoercion extends TypeCoercionBase {
case other => other
}
p.makeCopy(Array(a, newList))
+
+ case d @ DateAdd(left @ StringType(), _) if left.foldable =>
Review comment:
I prefer to put all the string literal promotion here. Let me update the comment.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685037375
##########
File path: sql/core/src/test/resources/sql-tests/results/ansi/timestamp.sql.out
##########
@@ -590,6 +590,58 @@ org.apache.spark.sql.AnalysisException
cannot resolve '1 + (- INTERVAL '02' SECOND)' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, '1' is of int type.; line 1 pos 7
+-- !query
+select '2011-11-11 11:11:11' - date'2011-11-11'
+-- !query schema
+struct<(2011-11-11 11:11:11 - DATE '2011-11-11'):interval day>
+-- !query output
+0 00:00:00.000000000
+
+
+-- !query
+select '2011-11-11 11:11:11' - timestamp'2011-11-11 11:11:10'
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+cannot resolve '('2011-11-11 11:11:11' - TIMESTAMP '2011-11-11 11:11:10')' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, ''2011-11-11 11:11:11'' is of string type.; line 1 pos 7
Review comment:
why does this fail under ansi mode?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894218230
**[Test build #142160 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142160/testReport)** for PR 33666 at commit [`653d0c6`](https://github.com/apache/spark/commit/653d0c6cb31fda012df85bcf4eeb795f0a628469).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894126380
**[Test build #142155 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142155/testReport)** for PR 33666 at commit [`21391c4`](https://github.com/apache/spark/commit/21391c45682642eb9ae5f9a4fc77345149733ff2).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685775904
##########
File path: sql/core/src/test/resources/sql-tests/inputs/date.sql
##########
@@ -104,6 +110,7 @@ select date '2001-09-28' - null;
select '2011-11-11' - interval '2' day;
select null - date '2019-10-06';
select date '2001-10-01' - date '2001-09-28';
+select '2011-11-11 11:11:11' - date'2011-11-11';
Review comment:
nit: we can put `select str - date'2011-11-11' from v2;` here.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895861008
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46770/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895852712
Kubernetes integration test unable to build dist.
exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46770/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895818979
Kubernetes integration test unable to build dist.
exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46768/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895796370
**[Test build #142261 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142261/testReport)** for PR 33666 at commit [`eb0b080`](https://github.com/apache/spark/commit/eb0b0800461eaa3e0684a212e27d1300bf6b9024).
* This patch **fails to build**.
* 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r686089448
##########
File path: sql/core/src/test/resources/sql-tests/results/date.sql.out
##########
@@ -331,12 +331,20 @@ struct<date_add(DATE '2011-11-11', 1):date>
-- !query
-select date_add(timestamp_ltz'2011-11-11 12:12:12', 1), date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
+select date_add(timestamp_ltz'2011-11-11 12:12:12', 1)
+-- !query schema
+struct<date_add(TIMESTAMP '2011-11-11 12:12:12', 1):date>
+-- !query output
+2011-11-12
+
+
+-- !query
+select date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
Review comment:
It's a different topic. Breaking change means it's very hard to enable NTZ by default in the future.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685039507
##########
File path: sql/core/src/test/resources/sql-tests/results/timestamp.sql.out
##########
@@ -571,6 +571,56 @@ org.apache.spark.sql.AnalysisException
cannot resolve '1 + (- INTERVAL '02' SECOND)' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, '1' is of int type.; line 1 pos 7
+-- !query
+select '2011-11-11 11:11:11' - date'2011-11-11'
+-- !query schema
+struct<(2011-11-11 11:11:11 - DATE '2011-11-11'):interval day>
+-- !query output
+0 00:00:00.000000000
+
+
+-- !query
+select '2011-11-11 11:11:11' - timestamp'2011-11-11 11:11:10'
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+cannot resolve '('2011-11-11 11:11:11' - TIMESTAMP '2011-11-11 11:11:10')' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, ''2011-11-11 11:11:11'' is of string type.; line 1 pos 7
Review comment:
this fails in non-ansi mode as well... weird
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894423725
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46674/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894403915
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142160/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894464710
Kubernetes integration test unable to build dist.
exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46668/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895796418
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894218230
**[Test build #142160 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142160/testReport)** for PR 33666 at commit [`653d0c6`](https://github.com/apache/spark/commit/653d0c6cb31fda012df85bcf4eeb795f0a628469).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894318814
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46668/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r684322378
##########
File path: sql/core/src/test/resources/sql-tests/inputs/timestamp.sql
##########
@@ -102,6 +102,13 @@ select timestamp'2011-11-11 11:11:11' - interval '2' second;
select '2011-11-11 11:11:11' - interval '2' second;
select '1' - interval '2' second;
select 1 - interval '2' second;
+select '2011-11-11 11:11:11' - date'2011-11-11';
Review comment:
> how about string - date/timestamp?
I have added a new test case. But it seems that `string - date` will be `cast(string as date) - date`. Should we move it to date.sql or just leave it here?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895395065
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46741/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894391552
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46674/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894455354
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46681/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894403915
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142160/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895792927
**[Test build #142261 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142261/testReport)** for PR 33666 at commit [`eb0b080`](https://github.com/apache/spark/commit/eb0b0800461eaa3e0684a212e27d1300bf6b9024).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895864510
**[Test build #142270 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142270/testReport)** for PR 33666 at commit [`0e7ce1d`](https://github.com/apache/spark/commit/0e7ce1dc1903625d9c8b3320dafea91b6b186703).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-896048276
**[Test build #142270 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142270/testReport)** for PR 33666 at commit [`0e7ce1d`](https://github.com/apache/spark/commit/0e7ce1dc1903625d9c8b3320dafea91b6b186703).
* 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685777557
##########
File path: sql/core/src/test/resources/sql-tests/results/date.sql.out
##########
@@ -331,12 +331,20 @@ struct<date_add(DATE '2011-11-11', 1):date>
-- !query
-select date_add(timestamp_ltz'2011-11-11 12:12:12', 1), date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
+select date_add(timestamp_ltz'2011-11-11 12:12:12', 1)
+-- !query schema
+struct<date_add(TIMESTAMP '2011-11-11 12:12:12', 1):date>
+-- !query output
+2011-11-12
+
+
+-- !query
+select date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
Review comment:
if `timestamp_ntz` becomes the default in the future, it's better to support this query as well to not break anything.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895931989
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46778/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894357104
**[Test build #142168 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142168/testReport)** for PR 33666 at commit [`17470db`](https://github.com/apache/spark/commit/17470db596d8a693ce73dd17f66e170185926ff7).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r686090686
##########
File path: sql/core/src/test/resources/sql-tests/results/date.sql.out
##########
@@ -331,12 +331,20 @@ struct<date_add(DATE '2011-11-11', 1):date>
-- !query
-select date_add(timestamp_ltz'2011-11-11 12:12:12', 1), date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
+select date_add(timestamp_ltz'2011-11-11 12:12:12', 1)
+-- !query schema
+struct<date_add(TIMESTAMP '2011-11-11 12:12:12', 1):date>
+-- !query output
+2011-11-12
+
+
+-- !query
+select date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
Review comment:
I think we tend to make LTZ/NTZ behavior consistent within default mode, or within ANSI mode, but not between default and ANSI mode.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685039179
##########
File path: sql/core/src/test/resources/sql-tests/results/datetime-legacy.sql.out
##########
@@ -1107,6 +1131,57 @@ org.apache.spark.sql.AnalysisException
cannot resolve '1 + (- INTERVAL '02' SECOND)' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, '1' is of int type.; line 1 pos 7
+-- !query
+select '2011-11-11 11:11:11' - date'2011-11-11'
+-- !query schema
+struct<(2011-11-11 11:11:11 - DATE '2011-11-11'):interval day>
+-- !query output
+0 00:00:00.000000000
+
+
+-- !query
+select '2011-11-11 11:11:11' - timestamp'2011-11-11 11:11:10'
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+cannot resolve '('2011-11-11 11:11:11' - TIMESTAMP '2011-11-11 11:11:10')' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, ''2011-11-11 11:11:11'' is of string type.; line 1 pos 7
+
+
+-- !query
+create temp view v as select '2011-11-11 11:11:11' str
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.catalyst.analysis.TempTableAlreadyExistsException
+Temporary view 'v' already exists
Review comment:
seems we need to change the temp view name
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894423725
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46674/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894145789
**[Test build #142155 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142155/testReport)** for PR 33666 at commit [`21391c4`](https://github.com/apache/spark/commit/21391c45682642eb9ae5f9a4fc77345149733ff2).
* This patch **fails Spark unit 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-896059291
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142270/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang commented on pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895800947
jenkins, retest this please
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894422807
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46674/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894483189
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46681/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895395065
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895963829
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46778/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895973472
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46778/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895796418
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142261/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r686472001
##########
File path: sql/core/src/test/resources/sql-tests/results/date.sql.out
##########
@@ -331,12 +331,20 @@ struct<date_add(DATE '2011-11-11', 1):date>
-- !query
-select date_add(timestamp_ltz'2011-11-11 12:12:12', 1), date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
+select date_add(timestamp_ltz'2011-11-11 12:12:12', 1)
+-- !query schema
+struct<date_add(TIMESTAMP '2011-11-11 12:12:12', 1):date>
+-- !query output
+2011-11-12
+
+
+-- !query
+select date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
Review comment:
I will have a follow-up for NTZ behavior.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895822349
**[Test build #142262 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142262/testReport)** for PR 33666 at commit [`eb0b080`](https://github.com/apache/spark/commit/eb0b0800461eaa3e0684a212e27d1300bf6b9024).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685824584
##########
File path: sql/core/src/test/resources/sql-tests/results/date.sql.out
##########
@@ -331,12 +331,20 @@ struct<date_add(DATE '2011-11-11', 1):date>
-- !query
-select date_add(timestamp_ltz'2011-11-11 12:12:12', 1), date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
+select date_add(timestamp_ltz'2011-11-11 12:12:12', 1)
+-- !query schema
+struct<date_add(TIMESTAMP '2011-11-11 12:12:12', 1):date>
+-- !query output
+2011-11-12
+
+
+-- !query
+select date_add(timestamp_ntz'2011-11-11 12:12:12', 1)
Review comment:
The LTZ one will fail in ANSI mode. We tend to make the NTZ behavior consistent in default/ANSI mode, right?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r684290467
##########
File path: sql/core/src/test/resources/sql-tests/inputs/timestamp.sql
##########
@@ -102,6 +102,8 @@ select timestamp'2011-11-11 11:11:11' - interval '2' second;
select '2011-11-11 11:11:11' - interval '2' second;
select '1' - interval '2' second;
select 1 - interval '2' second;
+create or replace temp view v as select '2011-11-11' str;
+select str - interval '2' second from v;
Review comment:
how about string - date/timestamp?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894487507
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46681/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895820978
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46768/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894514721
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142168/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895792927
**[Test build #142261 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142261/testReport)** for PR 33666 at commit [`eb0b080`](https://github.com/apache/spark/commit/eb0b0800461eaa3e0684a212e27d1300bf6b9024).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894511645
**[Test build #142168 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142168/testReport)** for PR 33666 at commit [`17470db`](https://github.com/apache/spark/commit/17470db596d8a693ce73dd17f66e170185926ff7).
* 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685032511
##########
File path: sql/core/src/test/resources/sql-tests/inputs/timestamp.sql
##########
@@ -102,6 +102,13 @@ select timestamp'2011-11-11 11:11:11' - interval '2' second;
select '2011-11-11 11:11:11' - interval '2' second;
select '1' - interval '2' second;
select 1 - interval '2' second;
+select '2011-11-11 11:11:11' - date'2011-11-11';
Review comment:
let's put it in `date.sql`, as we don't need to test this query 4 times with different timestamp settings.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685827266
##########
File path: sql/core/src/test/resources/sql-tests/inputs/date.sql
##########
@@ -104,6 +110,7 @@ select date '2001-09-28' - null;
select '2011-11-11' - interval '2' day;
select null - date '2019-10-06';
select date '2001-10-01' - date '2001-09-28';
+select '2011-11-11 11:11:11' - date'2011-11-11';
Review comment:
Done
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-895354341
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46741/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-896013372
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142262/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894357104
**[Test build #142168 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/142168/testReport)** for PR 33666 at commit [`17470db`](https://github.com/apache/spark/commit/17470db596d8a693ce73dd17f66e170185926ff7).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894148136
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142155/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894318814
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46668/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685337963
##########
File path: sql/core/src/test/resources/sql-tests/results/ansi/timestamp.sql.out
##########
@@ -590,6 +590,58 @@ org.apache.spark.sql.AnalysisException
cannot resolve '1 + (- INTERVAL '02' SECOND)' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, '1' is of int type.; line 1 pos 7
+-- !query
+select '2011-11-11 11:11:11' - date'2011-11-11'
+-- !query schema
+struct<(2011-11-11 11:11:11 - DATE '2011-11-11'):interval day>
+-- !query output
+0 00:00:00.000000000
+
+
+-- !query
+select '2011-11-11 11:11:11' - timestamp'2011-11-11 11:11:10'
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+cannot resolve '('2011-11-11 11:11:11' - TIMESTAMP '2011-11-11 11:11:10')' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, ''2011-11-11 11:11:11'' is of string type.; line 1 pos 7
Review comment:
shall we fix it under ansi mode? this is inconsistent: `string_literal - date` works but `string_literal - timestamp` does not.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] cloud-fan commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r684287105
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AnsiTypeCoercion.scala
##########
@@ -289,6 +289,13 @@ object AnsiTypeCoercion extends TypeCoercionBase {
case other => other
}
p.makeCopy(Array(a, newList))
+
+ case d @ DateAdd(left @ StringType(), _) if left.foldable =>
Review comment:
shall we put these 3 in `DateTimeOperations`? The doc of this rule says `Promotes string literals that appear in arithmetic and comparison expressions.`.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] gengliangwang commented on a change in pull request #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #33666:
URL: https://github.com/apache/spark/pull/33666#discussion_r685262728
##########
File path: sql/core/src/test/resources/sql-tests/results/ansi/timestamp.sql.out
##########
@@ -590,6 +590,58 @@ org.apache.spark.sql.AnalysisException
cannot resolve '1 + (- INTERVAL '02' SECOND)' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, '1' is of int type.; line 1 pos 7
+-- !query
+select '2011-11-11 11:11:11' - date'2011-11-11'
+-- !query schema
+struct<(2011-11-11 11:11:11 - DATE '2011-11-11'):interval day>
+-- !query output
+0 00:00:00.000000000
+
+
+-- !query
+select '2011-11-11 11:11:11' - timestamp'2011-11-11 11:11:10'
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+cannot resolve '('2011-11-11 11:11:11' - TIMESTAMP '2011-11-11 11:11:10')' due to data type mismatch: argument 1 requires (timestamp or timestamp without time zone) type, however, ''2011-11-11 11:11:11'' is of string type.; line 1 pos 7
Review comment:
We don't have a rule for this one
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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 #33666: [SPARK-36445][SQL] ANSI type coercion rule for date time operations
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33666:
URL: https://github.com/apache/spark/pull/33666#issuecomment-894148136
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/142155/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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