This is an automated email from the ASF dual-hosted git repository.

tjbanghart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/main by this push:
     new 3157408a12 [CALCITE-6092] Skip breaking CAST String to TIME tests 
until fixed in Avatica 1.24.0
3157408a12 is described below

commit 3157408a127de0d5c1d6b440bd2086f96f4f91ba
Author: Jerin John <[email protected]>
AuthorDate: Tue Nov 7 10:37:14 2023 -0800

    [CALCITE-6092] Skip breaking CAST String to TIME tests until fixed in 
Avatica 1.24.0
---
 core/src/main/java/org/apache/calcite/util/Bug.java                | 6 ++++++
 testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/calcite/util/Bug.java 
b/core/src/main/java/org/apache/calcite/util/Bug.java
index 8f36d07eee..90dce754cb 100644
--- a/core/src/main/java/org/apache/calcite/util/Bug.java
+++ b/core/src/main/java/org/apache/calcite/util/Bug.java
@@ -200,6 +200,12 @@ public abstract class Bug {
    * MILLISECOND and MICROSECOND units in INTERVAL literal</a> is fixed. */
   public static final boolean CALCITE_5422_FIXED = false;
 
+  /** Whether
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-6092";>[CALCITE-6092]
+   * Invalid test cases in CAST String to Time</a> is fixed.
+   * Fix to be available with Avatica 1.24.0 [CALCITE-6053] */
+  public static final boolean CALCITE_6092_FIXED = false;
+
   /**
    * Use this to flag temporary code.
    */
diff --git a/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java 
b/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
index e755747681..9f4a2da563 100644
--- a/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
+++ b/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
@@ -1234,8 +1234,11 @@ public class SqlOperatorTest {
     } else {
       f.checkNull("cast('nottime' as TIME)");
     }
-    f.checkScalar("cast('1241241' as TIME)", "72:40:12", "TIME(0) NOT NULL");
-    f.checkScalar("cast('12:54:78' as TIME)", "12:55:18", "TIME(0) NOT NULL");
+
+    if (Bug.CALCITE_6092_FIXED) {
+      f.checkFails("cast('1241241' as TIME)", "Invalid TIME value, '1241241'", 
true);
+      f.checkFails("cast('12:54:78' as TIME)", "Invalid TIME value, 
'12:54:78'", true);
+    }
     f.checkScalar("cast('12:34:5' as TIME)", "12:34:05", "TIME(0) NOT NULL");
     f.checkScalar("cast('12:3:45' as TIME)", "12:03:45", "TIME(0) NOT NULL");
     f.checkScalar("cast('1:23:45' as TIME)", "01:23:45", "TIME(0) NOT NULL");

Reply via email to