You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "izveigor (via GitHub)" <gi...@apache.org> on 2023/07/15 18:50:24 UTC
[GitHub] [arrow-datafusion] izveigor opened a new issue, #6974: Implement `array_element` function
izveigor opened a new issue, #6974:
URL: https://github.com/apache/arrow-datafusion/issues/6974
### Is your feature request related to a problem or challenge?
## Summary
| Characteristic | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Function name: | `array_element` |
| Aliases: | `array_extract`, `list_element`, `list_extract`, `array[i]` |
| Original function?: | No |
| Function Description: | <b>Clickhouse:</b> Get the element with the index n from the array arr. n must be any integer type. Indexes in an array begin from one. Negative indexes are supported. In this case, it selects the corresponding element numbered from the end. For example, arr[-1] is the last item in the array. If the index falls outside of the bounds of an array, it returns some default value (0 for numbers, an empty string for strings, etc.), except for the case with a non-constant array and a constant index 0 (in this case there will be an error Array indices are 1-based). <br> <b>DuckDB:</b> Extract the indexth (1-based) value from the list. <b> </b> |
| Sources: | [Concept](https://github.com/apache/arrow-datafusion/discussions/6855) [ClickHouse](https://clickhouse.com/docs/en/sql-reference/functions/array-functions#arrayelementarr-n-operator-arrn) [DuckDB](https://duckdb.org/docs/sql/functions/nested) |
## Examples:
```
select array_element([1, 2, 3, 4], 3);
----
3
```
```
select array_element([1, 2, 3, 4], 1);
----
1
```
### Describe the solution you'd like
_No response_
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb closed issue #6974: Implement `array_element` function
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #6974: Implement `array_element` function
URL: https://github.com/apache/arrow-datafusion/issues/6974
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org