sakshichitnis27 opened a new pull request, #20664: URL: https://github.com/apache/druid/pull/20664
Fixes #20631. ### Description Druid attempts to reduce `ARRAY<COMPLEX<json>>` constants through `RexBuilder.makeLiteral`, which recurses until a `StackOverflowError` occurs. This change leaves arrays with complex element types as expressions, matching the existing handling for complex scalar constants. It also adds a regression test using `JSON_QUERY_ARRAY` over a constant JSON value. #### Release note Fixes SQL planning failures when `JSON_QUERY_ARRAY` is applied to a constant JSON value. ### Testing - Added `CalciteNestedDataQueryTest.testUnnestJsonQueryArrayOfConstantJson`. - Verified the regression test fails with `StackOverflowError` before the fix. - Ran `./mvnw test -pl sql -am -Dtest="org.apache.druid.sql.calcite.*CalciteNestedDataQueryTest" -Dsurefire.failIfNoSpecifiedTests=false -Pskip-static-checks -Dweb.console.skip=true -T1C`. - Result: 522 tests passed with no failures or errors. <hr> ##### Key changed classes in this PR - `DruidRexExecutor` - `CalciteNestedDataQueryTest` <hr> This PR has: - [x] been self-reviewed. - [x] a release note entry in the PR description. - [x] added comments explaining the why and intent of the code. - [x] added or updated tests to cover the new code path. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
