WisniowskiPiotr opened a new issue, #26911:
URL: https://github.com/apache/beam/issues/26911
### What happened?
In Beam SQL shell (tested with calcite, DirectRunner, DataFlow, v2.47.0 and
latest main on linux):
```
CREATE EXTERNAL TABLE test_tmp(
`ref` VARCHAR,
`commits` ARRAY<ROW<
`id` VARCHAR,
`author` ROW<
`name` VARCHAR,
`email` VARCHAR
>
>>
)
TYPE text
LOCATION 'python/dbt/tests/array_with_nested_rows_limitation.jsonl'
TBLPROPERTIES '{"format":"json", "deadLetterFile":"python/dbt/tests/dead"}';
SELECT
test_tmp.`ref` AS branch_name,
commit_item.`id` AS commit_hash,
commit_item.`author`.`name` AS author_name
FROM test_tmp
CROSS JOIN UNNEST(test_tmp.commits) AS commit_item;
```
gives
```
Row expected 4 fields (Field{name=ref, description=, type=STRING,
options={{}}}, Field{name=commits, description=, type=ARRAY<ROW<id STRING,
author ROW<name STRING, email STRING>> NOT NULL>, options={{}}}, Field{name=id,
description=, type=STRING, options={{}}}, Field{name=author, description=,
type=ROW<name STRING, email STRING>, options={{}}}). initialized with 5 fields.
```
Which essentially leaves no way to explode all elements of an array thru
SQL. Accessing a single element works as expected.
### Issue Priority
Priority: 1 (data loss / total loss of function)
### Issue Components
- [ ] Component: Python SDK
- [X] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]