You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2023/05/10 01:29:00 UTC
[jira] [Resolved] (CALCITE-5660) Implement BigQuery Array Subscript Operators
[ https://issues.apache.org/jira/browse/CALCITE-5660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Hyde resolved CALCITE-5660.
----------------------------------
Fix Version/s: 1.35.0
Resolution: Fixed
Fixed inĀ [ea9db442|https://github.com/apache/calcite/commit/ea9db4421f572c083f4724324df226edf1206f31]; thanks for the PR, [~tanclary]!
> Implement BigQuery Array Subscript Operators
> --------------------------------------------
>
> Key: CALCITE-5660
> URL: https://issues.apache.org/jira/browse/CALCITE-5660
> Project: Calcite
> Issue Type: Task
> Reporter: Tanner Clary
> Assignee: Tanner Clary
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.35.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When indexing an array in BigQuery, you are required to wrap the index in one of four position keywords: {{OFFSET}}, {{ORDINAL}}, {{SAFE_OFFSET}}, and {{SAFE_ORDINAL}}.
> {{OFFSET(index)}}: The index starts at zero. Produces an error if the index is out of range.
> {{SAFE_OFFSET(index)}}: The index starts at zero. Returns NULL if the index is out of range.
> {{ORDINAL(index)}}: The index starts at one. Produces an error if the index is out of range.
> {{SAFE_ORDINAL(index)}}: The index starts at one. Returns NULL if the index is out of range.
> These operators are very similar to the existing {{ITEM}} operator currently used to index an array in Calcite. I believe the offset and out of bounds behavior for the existing implementation could be parameterized to support the above operators.
> [Link to BigQuery docs|https://cloud.google.com/bigquery/docs/reference/standard-sql/operators#array_subscript_operator]
> I will have a PR open for this in the next day or two, in the meantime any comments, questions, or suggestions are welcome as always.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)