[CALCITE-3864] Supports CONCAT for variable arguments#1862
[CALCITE-3864] Supports CONCAT for variable arguments#1862DonnyZone merged 1 commit intoapache:masterfrom
Conversation
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
Outdated
Show resolved
Hide resolved
8f0a003 to
689780e
Compare
|
hi @wenhuitang In addition, you need to add function docs. |
The description of CONCAT(string [, string ]*) has already existed in Line 2325 of the document reference.md |
core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java
Outdated
Show resolved
Hide resolved
689780e to
517d0d5
Compare
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java
Outdated
Show resolved
Hide resolved
|
Some comments: |
|
There is no confusion. From user's perspective, when the library is specified, the function can be registered correctly. These two functions are placed in two distinct slots. |
703357f to
2cf7349
Compare
According to you comments, this pull request has been updated, thanks a lot. |
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java
Outdated
Show resolved
Hide resolved
|
Moreover, (1) add several tests in |
2cf7349 to
d0d787b
Compare
|
Comments has been addressed, and reference.md has been updated too. |
d0d787b to
782123b
Compare
|
+1, LGTM |
782123b to
7152d72
Compare
|
Close and reopen to trigger the checks. |
| tester3.setFor(SqlLibraryOperators.CONCAT2); | ||
| tester3.checkString("concat(cast('fe' as char(2)), cast('df' as varchar(65535)))", | ||
| "fedf", "VARCHAR NOT NULL"); | ||
| tester3.checkString("concat(cast('fe' as char(2)), cast('df' as varchar))", |
There was a problem hiding this comment.
Please add a test case whose parameter is empty.
chunweilei
left a comment
There was a problem hiding this comment.
Please also improve the commit message. For example, concat should be upper case. Besides, CONCAT is supported before, but CONCAT with var args is not supported.
|
In CALCITE-3235, Personally, I think "Implement CONCAT function" is ok. |
| /** | ||
| * Same as {@link #MULTIVALENT_STRING_SUM_PRECISION} and using | ||
| * {@link org.apache.calcite.sql.type.SqlTypeTransforms#TO_NULLABLE} | ||
| */ |
There was a problem hiding this comment.
End up the comment with dot.
| * | ||
| * concat(cast('a' as varchar(65535)), cast('b' as varchar(2)), cast('c' as varchar(2))) | ||
| * returns varchar | ||
| */ |
There was a problem hiding this comment.
Start with <p> If there is a blank line ahead. And end with dot.
"Supports CONCAT for variable arguments" seems fine to me. |
7152d72 to
413be6f
Compare
|
@DonnyZone @danny0405 @chunweilei Thanks a lot. I have addressed all the comments. And I'm ok with "Supports CONCAT for variable arguments", I will revise the relevant content. |
Pull request for https://issues.apache.org/jira/browse/CALCITE-3864