julianhyde commented on code in PR #3011:
URL: https://github.com/apache/calcite/pull/3011#discussion_r1063052461
##########
babel/src/test/resources/sql/big-query.iq:
##########
@@ -2596,4 +2596,18 @@ FROM items;
!ok
+#####################################################################
Review Comment:
Is there a reason that you added at the end? If not, find a rationale to add
it at a different position. Appends cause merge conflicts.
##########
babel/src/test/resources/sql/big-query.iq:
##########
@@ -2596,4 +2596,18 @@ FROM items;
!ok
+#####################################################################
Review Comment:
Yeah, it's my mistake. I knew this file was going to be large, so I should
have created it in alphabetical order.
##########
site/_docs/reference.md:
##########
@@ -2634,6 +2635,7 @@ semantics.
| m | JSON_STORAGE_SIZE(jsonValue) | Returns the number of
bytes used to store the binary representation of *jsonValue*
| b o | LEAST(expr [, expr ]* ) | Returns the least of
the expressions
| b m p | LEFT(string, length) | Returns the leftmost
*length* characters from the *string*
+| b | LENGTH(string) | Returns the number of
characters in the *string*
Review Comment:
Do what CHARACTER_LENGTH did: "As CHAR_LENGTH(string)"
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -6231,6 +6231,28 @@ void assertSubFunReturns(boolean binary, String s, int
start,
f0.forEachLibrary(list(SqlLibrary.BIG_QUERY, SqlLibrary.ORACLE), consumer);
}
+ @Test void testLengthFunc() {
Review Comment:
I'd move this test next to `testCharLengthFunc` because it is so similar.
Use the `f0.forEachLibrary(list(SqlLibrary.BIG_QUERY), consumer);` pattern
so that the test can be extended to other libraries in future.
##########
site/_docs/reference.md:
##########
@@ -1771,6 +1771,7 @@ period:
| {fn LENGTH(string)} | Returns the number of characters in a string
| {fn LOCATE(string1, string2 [, integer])} | Returns the position in
*string2* of the first occurrence of *string1*. Searches from the beginning of
*string2*, unless *integer* is specified.
| {fn LEFT(string, length)} | Returns the leftmost *length* characters from
*string*
+| {fn LENGTH(string)} | Returns the number of characters in *string*
Review Comment:
I don't believe that you have added (or want to add) JDBC function syntax
for LENGTH. remove this line
--
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]