JiajunBernoulli commented on code in PR #3501:
URL: https://github.com/apache/calcite/pull/3501#discussion_r1382710583
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -10497,6 +10497,29 @@ private static void
checkArrayConcatAggFuncFails(SqlOperatorFixture t) {
"[1 , 2 , Hi , null]", "CHAR(10) ARRAY NOT
NULL");
}
+ /**
+ * Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6091">[CALCITE-6091]
+ * Char that in array or map is truncated if CASE WHEN statement contains
null</a>.
+ */
+ @Test void testTruncatedCharInCaseWhen() {
+ final SqlOperatorFixture fixture = fixture().withLibrary(SqlLibrary.SPARK);
+ fixture.check("select case "
+ + "when true then array('abc') "
+ + "when false then array('d') "
+ + "else null "
Review Comment:
@mihaibudiu
Here is null value.
> When we omit `else`, it is also null.
If I remove my fix, the test will failed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]