[
https://issues.apache.org/jira/browse/CALCITE-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15819205#comment-15819205
]
Julian Hyde commented on CALCITE-420:
-------------------------------------
It should return the empty string, not null (except when we fix CALCITE-815
have {{SqlConformance#emptyStringIsNull}} enabled). I will change the test case
and implementation.
I checked Postgres:
{noformat}
foodmart=> select replace('ciao','ciao','') is null;
?column?
----------
f
(1 row)
{noformat}
> Add REPLACE character string function
> -------------------------------------
>
> Key: CALCITE-420
> URL: https://issues.apache.org/jira/browse/CALCITE-420
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Assignee: Julian Hyde
> Labels: newbie
>
> Oracle and MSSQL have a REPLACE function (see
> http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions134.htm). It
> is not in the SQL standard, and in fact the standard has no equivalent
> function.
> Syntax:
> {code:sql}
> REPLACE(char, search_string [, replace_string])
> {code}
> REPLACE is not a reserved word. Therefore the implementation will need to add
> REPLACE to CommonNonReservedKeyWord() in the parser.
> Note that Drill and potentially other users of Optiq use REPLACE as part of
> CREATE OR REPLACE syntax. Careful not to break that.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)