takaaki7 opened a new pull request, #4962: URL: https://github.com/apache/calcite/pull/4962
## Summary - Fixes [CALCITE-7546](https://issues.apache.org/jira/browse/CALCITE-7546): `SqlToRelConverter` throws `NullPointerException: fieldNames` for `UNNEST(<array>) AS <alias>` (no column list) under a conformance whose `allowAliasUnnestItems()` returns true (`SqlConformanceEnum.PRESTO`, plus user conformances overriding the flag). - `convertFrom`'s `AS` branch passes `fieldNames=null` to `convertUnnest` when the AS clause omits a column list. The PRESTO-only branch then called `requireNonNull(fieldNames, "fieldNames")` and threw NPE. - Fall back to default item aliases derived from `SqlUtil#deriveAliasFromOrdinal`, matching the names that `SqlUnnestOperator#inferReturnType` uses during validation. This keeps the relational row type aligned with the validator's underlying namespace, so both struct (e.g. `UNNEST(d.employees) AS e` → `e.empno`) and scalar element types (e.g. `UNNEST(d.admins) AS a` → `a`) resolve correctly. ## Test plan - [x] Added `testAliasUnnestArrayPlanWithoutColumnList` (struct array, PRESTO) — reproduces the NPE on `main`, passes after the fix. - [x] Added `testAliasUnnestScalarArrayPlanWithoutColumnList` (scalar varchar array, PRESTO). - [x] Existing PRESTO/UNNEST regression tests still pass: `testAliasUnnestArrayPlanWithSingleColumn`, `testAliasUnnestArrayPlanWithDoubleColumn`, `testUnnestArrayPlan`, `testUnnestArrayPlanAs`. - [x] Full `SqlToRelConverterTest` (663) and `RelToSqlConverterTest` (579) suites pass. -- 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]
