You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/04/16 04:40:25 UTC
[GitHub] [calcite] danny0405 opened a new pull request #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
danny0405 opened a new pull request #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
URL: https://github.com/apache/calcite/pull/1920
…s a wrong result
The RelDataTypeFactory#leastRestrictive finds the common type for IN,
CASE and SET operations. For common type with DATE and TIMESTAMP, it
returns DATE. The root cause is that rules in SqlTypeAssignmentRule
decide that DATE is assignable from TIMESTAMP, which is actually wrong.
Although in Java, this assignment makes sense but that
does not mean it's true in SQL, because DATE and TIMESTAMP have
different time unit.
Fix the rules in SqlTypeAssignmentRule and let the implicit type
coercion rule get involved.
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [calcite] chunweilei commented on a change in pull request #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
Posted by GitBox <gi...@apache.org>.
chunweilei commented on a change in pull request #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
URL: https://github.com/apache/calcite/pull/1920#discussion_r409319396
##########
File path: core/src/test/java/org/apache/calcite/test/JdbcTest.java
##########
@@ -7401,6 +7401,20 @@ private void checkGetTimestamp(Connection con) throws SQLException {
.runs();
}
+ /**
+ * Test case for
+ * <a href="https://issues.apache.org/jira/browse/CALCITE-3894">[CALCITE-3894]
+ * The Union operation between DATE with TIMESTAMP returns a wrong result</a>.
+ */
+ @Test public void testUnionDateTime() {
+ CalciteAssert.AssertThat assertThat = CalciteAssert.that();
+ String query = "select * from (\n"
Review comment:
between DATE with TIMESTAMP -> between DATE and 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [calcite] DonnyZone commented on issue #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
Posted by GitBox <gi...@apache.org>.
DonnyZone commented on issue #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
URL: https://github.com/apache/calcite/pull/1920#issuecomment-614442693
+1
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [calcite] danny0405 merged pull request #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
Posted by GitBox <gi...@apache.org>.
danny0405 merged pull request #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
URL: https://github.com/apache/calcite/pull/1920
----------------------------------------------------------------
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
With regards,
Apache Git Services
[GitHub] [calcite] danny0405 commented on a change in pull request #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #1920: [CALCITE-3894] The Union operation between DATE with TIMESTAMP return…
URL: https://github.com/apache/calcite/pull/1920#discussion_r409357192
##########
File path: core/src/test/java/org/apache/calcite/test/JdbcTest.java
##########
@@ -7401,6 +7401,20 @@ private void checkGetTimestamp(Connection con) throws SQLException {
.runs();
}
+ /**
+ * Test case for
+ * <a href="https://issues.apache.org/jira/browse/CALCITE-3894">[CALCITE-3894]
+ * The Union operation between DATE with TIMESTAMP returns a wrong result</a>.
+ */
+ @Test public void testUnionDateTime() {
+ CalciteAssert.AssertThat assertThat = CalciteAssert.that();
+ String query = "select * from (\n"
Review comment:
Yep, thanks.
----------------------------------------------------------------
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
With regards,
Apache Git Services