tanclary commented on code in PR #3565:
URL: https://github.com/apache/calcite/pull/3565#discussion_r1434526658
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -8878,51 +8878,106 @@ private void testCurrentDateFunc(Pair<String,
Hook.Closeable> pair) {
}
@Test void testStartsWithFunction() {
- final SqlOperatorFixture f = fixture().withLibrary(SqlLibrary.BIG_QUERY);
- f.setFor(SqlLibraryOperators.STARTS_WITH);
- f.checkBoolean("starts_with('12345', '123')", true);
- f.checkBoolean("starts_with('12345', '1243')", false);
- f.checkBoolean("starts_with(x'11', x'11')", true);
- f.checkBoolean("starts_with(x'112211', x'33')", false);
- f.checkFails("^starts_with('aabbcc', x'aa')^",
- "Cannot apply 'STARTS_WITH' to arguments of type "
- + "'STARTS_WITH\\(<CHAR\\(6\\)>, <BINARY\\(1\\)>\\)'\\. Supported "
- + "form\\(s\\): 'STARTS_WITH\\(<STRING>, <STRING>\\)'",
- false);
- f.checkNull("starts_with(null, null)");
- f.checkNull("starts_with('12345', null)");
- f.checkNull("starts_with(null, '123')");
- f.checkBoolean("starts_with('', '123')", false);
- f.checkBoolean("starts_with('', '')", true);
- f.checkNull("starts_with(x'aa', null)");
- f.checkNull("starts_with(null, x'aa')");
- f.checkBoolean("starts_with(x'1234', x'')", true);
- f.checkBoolean("starts_with(x'', x'123456')", false);
- f.checkBoolean("starts_with(x'', x'')", true);
+ final SqlOperatorFixture f0 = fixture();
Review Comment:
Yeah I was thinking this too.
I filed https://issues.apache.org/jira/browse/CALCITE-6172 in the meantime
while I think about it.
--
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]