[ 
https://issues.apache.org/jira/browse/CALCITE-5922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17754436#comment-17754436
 ] 

hongyu guo edited comment on CALCITE-5922 at 8/15/23 6:30 AM:
--------------------------------------------------------------

Hi, Julian. Thank you for you replay.

I change the summary to 

_The SQL generated for the POSITION function(with 3 input arguments) by the 
SparkSqlDialect is not recognized by Spark SQL._


was (Author: JIRAUSER300840):
Hi Julian~

Thank you for you replay,

I change the summary to 

_The SQL generated for the POSITION function(with 3 input arguments) by the 
SparkSqlDialect is not recognized by Spark SQL._

> The SQL generated for the POSITION function(with 3 input arguments) by the 
> SparkSqlDialect is not recognized by Spark SQL.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-5922
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5922
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.35.0
>            Reporter: hongyu guo
>            Assignee: hongyu guo
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.36.0
>
>
> In SparkSQL, POSITION(substr, str[, pos]) function only accept 
> comma-separated when there are 3 arguments.
> For example:
> {code:java}
> // SparkSQL accepted SQL
> select POSITION('a', 'abc', 1);{code}
> Calcite will use the IN and FROM keyword to separate the input arguments when 
> unparsing.
> {code:java}
> // Calcite accepted and unparsed SQL
> select POSITION('a' IN 'abc' FROM 1){code}
> For 2 augument inputs, SparkSQL accept both syntaxes. So I think we should 
> write a rule in SparkSqlDialect to convert keyword-separated syntax to 
> comma-separted syntax for POSITION function.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to