handle missing fields in SQL as null - #7295
Open
mccanne wants to merge 1 commit into
Open
Conversation
This commit improves SQL semantics in the face of missing fields by turning them into nulls and adding a nullish coalescing variant of the . operator to propagate nulls in a path expression. This operator is inserted by the semantic pass and is not user visible. It is displayed in DAG output as "??.". To make this work, we fixed a problem in the optimizer where the flags in field.Chain weren't being propagated. This also fixed a problem in agg functions like count which are supposed to ignore nulls. The change to change-star.yaml reflects this, where this test is now has a SQL-compatible result. Closes #5984
Contributor
|
A run of this branch at 7c021ad on the current sqllogic-ztests triggered 124 new similar failures in the "groupby" set, such as groupby/slt_good_0/q2177.yaml. Here's a simplified, self-contained repro: Whereas that works ok on current tip of I had Claude come up with the simplified repro, so it also gave its take on root cause and possible fixes, and that's available in a Gist if it helps at all. |
Contributor
|
Another finding along the way that's mentioned in that Gist is that on this branch the Whereas they're maintained on tip of |
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.
This commit improves SQL semantics in the face of missing fields by turning them into nulls and adding a nullish coalescing variant of the . operator to propagate nulls in a path expression. This operator is inserted by the semantic pass and is not user visible. It is displayed in DAG output as "??.".
To make this work, we fixed a problem in the optimizer where the flags in field.Chain weren't being propagated.
This also fixed a problem in agg functions like count which are supposed to ignore nulls. The change to change-star.yaml reflects this, where this test is now has a SQL-compatible result.
Closes #5984