Skip to content

Support STRING_ARRAY literal rendering - #19246

Merged
xiangfu0 merged 1 commit into
apache:masterfrom
xiangfu0:xiangfu0/string-array-literal
Aug 13, 2026
Merged

Support STRING_ARRAY literal rendering#19246
xiangfu0 merged 1 commit into
apache:masterfrom
xiangfu0:xiangfu0/string-array-literal

Conversation

@xiangfu0

Copy link
Copy Markdown
Contributor

Summary

  • render STRING_ARRAY values in LiteralContext
  • add unit coverage for Thrift STRING_ARRAY_VALUE conversion and rendering
  • add an ArrayTest integration test that validates ingested multi-value STRING data and composed string-array literals in projections and ARRAYS_OVERLAP filters with both query engines

Reproduction

Before this change, a table-backed single-stage query such as:

SELECT intCol, stringArrayCol, ARRAY['query-a', 'query-b']
FROM ArrayTest
WHERE intCol = 0

folds the array constructor into a Thrift STRING_ARRAY_VALUE. When the server builds the selection result schema, LiteralContext.toString() throws:

IllegalStateException: Unsupported PinotDataType: STRING_ARRAY

Literal-only queries avoid the server selection path, which is why the failure requires a table-backed projection.

Validation

  • LiteralContextTest: 11 tests passed
  • ./mvnw -pl pinot-integration-tests -am -Dtest=ArrayTest#testFoldedStringArrayLiteralWithIngestedColumn -Dsurefire.failIfNoSpecifiedTests=false test: 2 tests passed, covering both query engines
  • ./mvnw spotless:apply -pl pinot-common,pinot-integration-tests
  • ./mvnw checkstyle:check -pl pinot-common,pinot-integration-tests
  • ./mvnw license:format -pl pinot-common,pinot-integration-tests
  • ./mvnw license:check -pl pinot-common,pinot-integration-tests

@xiangfu0
xiangfu0 marked this pull request as ready for review August 13, 2026 15:52
@xiangfu0
xiangfu0 requested review from Jackie-Jiang and a lite review from Copilot August 13, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes server-side rendering of folded STRING_ARRAY literals by teaching LiteralContext.toString() how to format PinotDataType.STRING_ARRAY, and adds unit + integration coverage to prevent regressions across both query engines.

Changes:

  • Add STRING_ARRAY rendering support in LiteralContext.toString().
  • Add unit test coverage for Thrift STRING_ARRAY_VALUE conversion + rendering behavior.
  • Add an integration test that validates multi-value STRING ingestion and folded string-array literal behavior (projection + ARRAYS_OVERLAP) under both query engines.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pinot-common/src/main/java/org/apache/pinot/common/request/context/LiteralContext.java Adds STRING_ARRAY handling to toString() to avoid IllegalStateException during result rendering.
pinot-common/src/test/java/org/apache/pinot/common/request/context/LiteralContextTest.java Adds a focused unit test validating STRING_ARRAY_VALUE conversion and toString() output.
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/custom/ArrayTest.java Adds an integration test covering ingested MV STRING column behavior plus folded string-array literals and ARRAYS_OVERLAP filtering across engines.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +533 to +534
// Selecting an ingested column sends the single-stage query to the servers, where the folded STRING_ARRAY literal
// is rendered. The returned column also verifies the Avro multi-value STRING data was ingested correctly.
@Jackie-Jiang Jackie-Jiang added bug Something is not working as expected query Related to query processing labels Aug 13, 2026

@Jackie-Jiang Jackie-Jiang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about MV BYTES? If needed, make a separate PR for it

@xiangfu0
xiangfu0 merged commit 95e18b1 into apache:master Aug 13, 2026
12 checks passed
@xiangfu0
xiangfu0 deleted the xiangfu0/string-array-literal branch August 13, 2026 19:58
@xiangfu0

Copy link
Copy Markdown
Contributor Author

How about MV BYTES? If needed, make a separate PR for it

#19247

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is not working as expected query Related to query processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants