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

Kent Yao commented on SPARK-46374:
----------------------------------

cc [~cloud_fan] [~dongjoon] [~gurwls223] [~maropu]

> Array Indexing is 1-based via ANSI SQL Standard
> -----------------------------------------------
>
>                 Key: SPARK-46374
>                 URL: https://issues.apache.org/jira/browse/SPARK-46374
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 4.0.0, 3.5.1, 3.4.3
>            Reporter: Kent Yao
>            Priority: Major
>
> SPARK-28402 was closed by the reporter, because he might think it's a 
> postgres specific feature.
>  
> {code: none}
> <element reference> ::=
>     <array value expression>
>        <left bracket or trigraph> <numeric value expression> <right bracket 
> or trigraph>
>   
> 1) If the value of  or  is the null value, then
> the result of  is the null value.
> 2) Let the value of  be i.
> Case:
> a) If i is greater than zero and less than or equal to the cardinality of ,
> then the result of  is the value of the i-th element of the value of .
>  {code}
> The numeric value expression in the range of *greater than zero and less than 
> or equal to the cardinality* a.k.a., [1, size(array)]
> Who supports?(Incomplete)
> - postgres
> - Oracle
> - trino/presto
> - MySQL
> Who doesn't support?(Incomplete)
> - hive
> - spark sql (ANSI off/on)
> For ANSI compliance, we shall make array indexing 1-based when 
> spark.sql.ansi.enabled=true



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to