… in the EXPLODE function (#57050)
### What problem does this PR solve?
Since the EXPLODE function supports multiple arguments, its return value
is defined as a STRUCT type. Even when it has only a single argument, it
still returns a STRUCT.
Consider the following example:
```sql
SELECT *
FROM (SELECT 1) t1
LATERAL VIEW explode(array(struct('a', 1), struct('b', 2))) t2 AS c1, c2;
```
```text
+------+------------------------+
| 1 | c1 |
+------+------------------------+
| 1 | {"col1":"a", "col2":1} |
| 1 | {"col1":"b", "col2":2} |
+------+------------------------+
```
In this SQL statement, the return value of the EXPLODE function is a
nested STRUCT (that is, the child column inside the struct is struct
too).
As a result, the final output extracts the child column from the outer
struct, but those child columns themselves are not correctly assigned to
c1 and c2.
With this PR, the result will be like this:
```text
+------+------+------+
| 1 | c1 | c2 |
+------+------+------+
| 1 | a | 1 |
| 1 | b | 2 |
+------+------+------+
```
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
What problem does this PR solve?
Since the EXPLODE function supports multiple arguments, its return value is defined as a STRUCT type. Even when it has only a single argument, it still returns a STRUCT.
Consider the following example:
In this SQL statement, the return value of the EXPLODE function is a nested STRUCT (that is, the child column inside the struct is struct too).
As a result, the final output extracts the child column from the outer struct, but those child columns themselves are not correctly assigned to c1 and c2.
With this PR, the result will be like this:
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)