[
https://issues.apache.org/jira/browse/CALCITE-6241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17814696#comment-17814696
]
EveyWu commented on CALCITE-6241:
----------------------------------
[~hongyuguo]
thanks for your advice,Comparing the duplicated PR,
the following additional functions are added
* DATE_FROM_UNIX_DATE
* TIMESTAMP_MICROS
* TIMESTAMP_MILLIS
* TIMESTAMP_SECONDS
And other functions are not included. The main differences are as follows:
* {*}CONVERT_TIMEZONE{*}: OperandType not matched, Spark
CONVERT_TIMEZONE([sourceTz, ]targetTz, sourceTs), PostgreSQL
CONVERT_TIMEZONE(tz1, tz2, datetime)
* {*}SPLIT{*}: OperandType not matched, Spark SPLIT(str, regex, limit),
BigQuery SPLIT(string [, delimiter]);
* {*}REGEXP_REPLACE{*}: OperandType not matched, Spark REGEXP_REPLACE(str,
regexp, rep[, position]), BigQuery REGEXP_REPLACE(value, regexp, rep [, pos [,
occurrence [, matchType]]]);
* {*}CONCAT_WS{*}:OperandType not matched, Spark CONCAT_WS(sep[, str |
array(str)]+), MySQL&PostgreSQL CONCAT_WS(separator, str1 [, string ]*);
* {*}TO_DATE{*}: OperandType not matched, Spark TO_DATE(date_str[, fmt]),
PostgreSQL TO_DATE(string1, string2);
* {*}TO_TIMESTAMP{*}: OperandType not matched;
* {*}CHR{*}: Spark returns ASCII code, same as CHAR, BigQuery returns UTF-8
code;
* {*}LOG{*}: OperandType not matched, Spark log(base, expr), BigQuery
LOG(value [, value2]);
> Enable a few existing functions to Spark library
> ------------------------------------------------
>
> Key: CALCITE-6241
> URL: https://issues.apache.org/jira/browse/CALCITE-6241
> Project: Calcite
> Issue Type: Improvement
> Reporter: EveyWu
> Priority: Minor
> Labels: pull-request-available
> Attachments: image-2024-02-06-17-11-31-144.png
>
>
> Add Spark as a supported library for functions that have already been
> implemented for other libraries.
> Spark Functions
> Link:[https://spark.apache.org/docs/latest/api/sql/index.html|https://spark.apache.org/docs/latest/api/sql/index.html#rtrim]
> Enable function List:
> * DECODE
> * NVL
> * IFNULL
> * LEN
> * LENGTH
> * LPAD
> * RPAD
> * LTRIM
> * RTRIM
> * ENDSWITH
> * STARTSWITH
> * GREATEST
> * LEAST
> * TRANSLATE
> * BOOL_AND
> * BOOL_OR
> * DATE_FROM_UNIX_DATE
> * UNIX_DATE
> * LEFT
> * REPEAT
> * RIGHT
> * SPACE
> * TIMESTAMP_SECONDS
> * TIMESTAMP_MILLIS
> * TIMESTAMP_MICROS
> * UNIX_SECONDS
> * UNIX_MILLIS
> * UNIX_MICROS
> * MD5
> * SHA1
> * POW
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)