This is an automated email from the ASF dual-hosted git repository.
rubenql 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 ed1f54fe28 [CALCITE-6483] Enable LEN and LENGTH in the correct
function libraries
ed1f54fe28 is described below
commit ed1f54fe28b00c24134a3e768250c7e54681a85b
Author: Norman Jordan <[email protected]>
AuthorDate: Wed Jul 17 14:15:00 2024 -0700
[CALCITE-6483] Enable LEN and LENGTH in the correct function libraries
Enabled the LEN function for:
* Amazon Redshift
* Snowflake
* Spark
Enabled the LENGTH function for:
* BigQuery
* Hive
* PostgreSQL
* Amazon Redshift
* Snowflake
* Spark
---
.../src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java | 4 ++--
site/_docs/reference.md | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git
a/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
b/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
index c582885f87..8d98f3fbe3 100644
--- a/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
+++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
@@ -287,12 +287,12 @@ public abstract class SqlLibraryOperators {
public static final SqlFunction IFNULL = NVL.withName("IFNULL");
/** The "LEN(string)" function. */
- @LibraryOperator(libraries = {SNOWFLAKE, SPARK})
+ @LibraryOperator(libraries = {REDSHIFT, SNOWFLAKE, SPARK})
public static final SqlFunction LEN =
SqlStdOperatorTable.CHAR_LENGTH.withName("LEN");
/** The "LENGTH(string)" function. */
- @LibraryOperator(libraries = {BIG_QUERY, SNOWFLAKE, SPARK})
+ @LibraryOperator(libraries = {BIG_QUERY, HIVE, POSTGRESQL, SNOWFLAKE, SPARK})
public static final SqlFunction LENGTH =
SqlStdOperatorTable.CHAR_LENGTH.withName("LENGTH");
diff --git a/site/_docs/reference.md b/site/_docs/reference.md
index 06a66ac65d..289f2e7e17 100644
--- a/site/_docs/reference.md
+++ b/site/_docs/reference.md
@@ -2804,8 +2804,8 @@ In the following:
| m | JSON_STORAGE_SIZE(jsonValue) | Returns the number of
bytes used to store the binary representation of *jsonValue*
| b o p r s | LEAST(expr [, expr ]* ) | Returns the least of
the expressions
| b m p r s | LEFT(string, length) | Returns the leftmost
*length* characters from the *string*
-| f s | LEN(string) | Equivalent to
`CHAR_LENGTH(string)`
-| b f s | LENGTH(string) | Equivalent to
`CHAR_LENGTH(string)`
+| f r s | LEN(string) | Equivalent to
`CHAR_LENGTH(string)`
+| b f h p r s | LENGTH(string) | Equivalent to
`CHAR_LENGTH(string)`
| h s | LEVENSHTEIN(string1, string2) | Returns the Levenshtein
distance between *string1* and *string2*
| b | LOG(numeric1 [, base ]) | Returns the logarithm
of *numeric1* to base *base*, or base e if *base* is not present, or error if
*numeric1* is 0 or negative
| m s | LOG([, base ], numeric1) | Returns the logarithm
of *numeric1* to base *base*, or base e if *base* is not present, or null if
*numeric1* is 0 or negative