[ https://issues.apache.org/jira/browse/CALCITE-6285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mihai Budiu resolved CALCITE-6285. ---------------------------------- Fix Version/s: 1.37.0 Resolution: Fixed Fixed in https://github.com/apache/calcite/commit/9bd371316da3bfbf1096142d69f0464100773590 > Function ARRAY_INSERT produces an incorrect result for negative indices > ----------------------------------------------------------------------- > > Key: CALCITE-6285 > URL: https://issues.apache.org/jira/browse/CALCITE-6285 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.36.0 > Reporter: Mihai Budiu > Assignee: Mihai Budiu > Priority: Minor > Labels: pull-request-available > Fix For: 1.37.0 > > > Here is a test taken from the Spark documentation page: > https://spark.apache.org/docs/latest/api/sql/index.html#array_insert > {code} > SELECT array_insert(array(5, 3, 2, 1), -4, 4); > [5,4,3,2,1] > {code} > The result produced by Calcite is: > [4,5,3,2,1] > The strange thing is that there are tests for negative indices. I wonder if > the original tests are wrong, or the behavior of this function in Spark was > changed since the tests were written. -- This message was sent by Atlassian Jira (v8.20.10#820010)