Skip to content

[CALCITE-7457] VALUES and SELECT produce different validation results for the same expression#4858

Open
dssysolyatin wants to merge 1 commit intoapache:mainfrom
dssysolyatin:fix-top-level-values-validation
Open

[CALCITE-7457] VALUES and SELECT produce different validation results for the same expression#4858
dssysolyatin wants to merge 1 commit intoapache:mainfrom
dssysolyatin:fix-top-level-values-validation

Conversation

@dssysolyatin
Copy link
Copy Markdown
Contributor

@dssysolyatin dssysolyatin commented Apr 1, 2026

Jira Link

CALCITE-7457

Changes Proposed

  • VALUES now routes through validateQuery, triggering TableConstructorNamespace.validateImpl validation (which calls validateValues and inferUnknownTypes). The fix is a validateCall override in SqlValuesOperator.
  • inferUnknownTypes no longer descends into subqueries (node.isA(SqlKind.QUERY)). Each query handles its own inferUnknownTypes during its own validation.
  • Added additional tests inside existing tests which can be dropped. Just to show that now SELECT and VALUES behaves the same way

@dssysolyatin dssysolyatin marked this pull request as ready for review April 1, 2026 09:01
@dssysolyatin dssysolyatin changed the title [CALCITE-7457] Top-level VALUES and SELECT produce different validation results for the same expression [CALCITE-7457] VALUES and SELECT produce different validation results for the same expression Apr 1, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@dssysolyatin dssysolyatin added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Apr 2, 2026

/** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-7457">[CALCITE-7457]
* Top-level VALUES and SELECT produce different validation results
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The javadoc should be removed "Top-level"?

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

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants