You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by li...@apache.org on 2022/11/16 01:13:48 UTC
[calcite] 01/02: [CALCITE-5383] Add CONCAT to BIG_QUERY dialect
This is an automated email from the ASF dual-hosted git repository.
libenchao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git
commit 12e9ad4550caf3482b33895d2067ba50177bb8ba
Author: Oliver Lee <ol...@google.com>
AuthorDate: Fri Nov 11 18:19:36 2022 +0000
[CALCITE-5383] Add CONCAT to BIG_QUERY dialect
Close #2970
---
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java | 2 +-
site/_docs/reference.md | 2 +-
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java | 1 +
3 files changed, 3 insertions(+), 2 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 306a33b39f..1cde5d140f 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
@@ -539,7 +539,7 @@ public abstract class SqlLibraryOperators {
/** The "CONCAT(arg, ...)" function that concatenates strings.
* For example, "CONCAT('a', 'bc', 'd')" returns "abcd". */
- @LibraryOperator(libraries = {MYSQL, POSTGRESQL})
+ @LibraryOperator(libraries = {MYSQL, POSTGRESQL, BIG_QUERY})
public static final SqlFunction CONCAT_FUNCTION =
new SqlFunction("CONCAT",
SqlKind.OTHER_FUNCTION,
diff --git a/site/_docs/reference.md b/site/_docs/reference.md
index 15abb9b23b..ddf4698ccb 100644
--- a/site/_docs/reference.md
+++ b/site/_docs/reference.md
@@ -2584,7 +2584,7 @@ semantics.
| o p | CHR(integer) | Returns the character whose UTF-8 code is *integer*
| o | COSH(numeric) | Returns the hyperbolic cosine of *numeric*
| o | CONCAT(string, string) | Concatenates two strings
-| m p | CONCAT(string [, string ]*) | Concatenates two or more strings
+| b m p | CONCAT(string [, string ]*) | Concatenates two or more strings
| m | COMPRESS(string) | Compresses a string using zlib compression and returns the result as a binary string.
| p | CONVERT_TIMEZONE(tz1, tz2, datetime) | Converts the timezone of *datetime* from *tz1* to *tz2*
| b | CURRENT_DATETIME([timezone]) | Returns the current time as a TIMESTAMP from *timezone*
diff --git a/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java b/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
index 9d011d7d50..70861df1c5 100644
--- a/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
+++ b/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
@@ -1834,6 +1834,7 @@ public class SqlOperatorTest {
final SqlOperatorFixture f = fixture();
checkConcatFunc(f.withLibrary(SqlLibrary.MYSQL));
checkConcatFunc(f.withLibrary(SqlLibrary.POSTGRESQL));
+ checkConcatFunc(f.withLibrary(SqlLibrary.BIG_QUERY));
checkConcat2Func(f.withLibrary(SqlLibrary.ORACLE));
}