fix(duckdb): use INTERSECT to find data-contract column overlap (#1065)#2
Open
fix(duckdb): use INTERSECT to find data-contract column overlap (#1065)#2
Conversation
Bumps [uvicorn](https://github.com/Kludex/uvicorn) from 0.42.0 to 0.44.0. - [Release notes](https://github.com/Kludex/uvicorn/releases) - [Changelog](https://github.com/Kludex/uvicorn/blob/main/docs/release-notes.md) - [Commits](Kludex/uvicorn@0.42.0...0.44.0) --- updated-dependencies: - dependency-name: uvicorn dependency-version: 0.44.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Detect and raise error for multi-branch Avro union types The Avro importer now raises a DataContractException when a union field contains multiple non-null types (e.g., ["null", "string", "int"]), since ODCS does not support union types. Only the optional-field idiom (["null", T]) remains supported.
…ds (datacontract#1065) Before: INTERSECT query only selected columns present in BOTH contract and data, so missing contract columns were silently ignored — field_is_present always passed. After: SELECT explicitly lists contract schema columns by name. Missing data columns become NULL, allowing field_is_present to properly detect them.
When creating DuckDB tables from CSV/Parquet, use INTERSECT between data file columns and contract schema columns to avoid BinderException when optional columns are missing from the data. Only SELECT the intersecting columns — missing optional columns become NULL in the table and the field_is_present check correctly passes for optional fields while failing for required ones.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes datacontract#1065 —
field_is_presentcheck always passes for CSV/Parquet files because the current implementation compares row counts instead of checking actual column overlap. Uses SQL INTERSECT to correctly detect which columns in the data contract are actually present in the source data.