tanclary commented on code in PR #3604:
URL: https://github.com/apache/calcite/pull/3604#discussion_r1438925996
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -4108,6 +4108,19 @@ static void checkRlikeFails(SqlOperatorFixture f) {
f.checkNull("CHARACTER_LENGTH(cast(null as varchar(1)))");
}
+ @Test void testLenFunc() {
Review Comment:
Added
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -4108,6 +4108,19 @@ static void checkRlikeFails(SqlOperatorFixture f) {
f.checkNull("CHARACTER_LENGTH(cast(null as varchar(1)))");
}
+ @Test void testLenFunc() {
+ final SqlOperatorFixture f0 = fixture().setFor(SqlLibraryOperators.LENGTH);
+ f0.checkFails("^length('hello')^",
+ "No match found for function signature LENGTH\\(<CHARACTER>\\)",
+ false);
+ final SqlOperatorFixture f = f0.withLibrary(SqlLibrary.SNOWFLAKE);
+ f.checkScalar("length('hello')", "5", "INTEGER NOT NULL");
+ f.checkScalar("length('')", "0", "INTEGER NOT NULL");
+ f.checkScalar("length(CAST('x' as CHAR(3)))", "3", "INTEGER NOT NULL");
+ f.checkScalar("length(CAST('x' as VARCHAR(4)))", "1", "INTEGER NOT NULL");
+ f.checkNull("length(CAST(NULL as CHAR(5)))");
Review Comment:
I just forgot to change them, fixed now
--
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]