Skip to content

[CALCITE-7717] Add a Collect.isValid method to check type invariants - #5180

Open
mihaibudiu wants to merge 2 commits into
apache:mainfrom
mihaibudiu:issue7717
Open

[CALCITE-7717] Add a Collect.isValid method to check type invariants#5180
mihaibudiu wants to merge 2 commits into
apache:mainfrom
mihaibudiu:issue7717

Conversation

@mihaibudiu

Copy link
Copy Markdown
Contributor

Jira Link

CALCITE-7717

@mihaibudiu

Copy link
Copy Markdown
Contributor Author

The new method is invoked automatically by the planner so it is already used by the existing tests that create Collect nodes.

@mihaibudiu
mihaibudiu force-pushed the issue7717 branch 2 times, most recently from de3580f to cac102f Compare August 14, 2026 05:11
if (getCollectionType() != SqlTypeName.MAP && inputRow.getFieldCount() == 1) {
// ARRAY or MULTISET over an input row with a single column: the type of
// the column should match the type of the array element
final RelDataType derivedFromColumn =

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.

Should we also compare against a type derived via SqlTypeUtil.deriveCollectionQueryComponentType here for the ARRAY/MULTISET query-constructor case, as Collect.create(..., SqlKind, ...) does?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I hope I understood your question
I have pushed a second commit, please take a look

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.

Yes, thanks. This is what I had in mind.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you like this, you can approve it.

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants