Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(3356): struct rewritter missed EXPLAIN #3398

Merged

Conversation

big-andy-coates
Copy link
Contributor

Description

Fixes: #3356

KSQL uses a statement rewritter to convert STRUCT field dereferences into FETCH_FIELD_FROM_STRUCT function calls. The rewrite is done for Query, C*AS and INSERT INTO statements, but was missing EXPLAIN.

It is valid to execute EXPLAIN on a query string, e.g. EXPLAIN SELECT address->street FROM Y;. It is therefore important that the query within the EXPLAIN statement has the same rewrites applied to it as would be applied should the statement be executed directly.

Testing done

Suitable unit tests added.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

KSQL uses a statement rewritter to convert STRUCT field dereferences into `FETCH_FIELD_FROM_STRUCT` function calls.  The rewrite is done for `Query`, `C*AS` and `INSERT INTO` statements, but was missing `EXPLAIN`.

It is valid to execute `EXPLAIN` on a query string, e.g.  `EXPLAIN SELECT address->street FROM Y;`.  It is therefore important that the query within the `EXPLAIN` statement has the same rewrites applied to it as would be applied should the statement be executed directly.
Copy link
Contributor

@vcrfxia vcrfxia left a comment

Choose a reason for hiding this comment

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

Thanks @big-andy-coates -- LGTM with a question inline.

@vcrfxia vcrfxia requested a review from a team September 23, 2019 14:36
Well, implied anyway
@big-andy-coates big-andy-coates merged commit daf974b into confluentinc:master Sep 23, 2019
@big-andy-coates big-andy-coates deleted the explain_struct_deref branch September 23, 2019 19:10
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.

5.4.0-beta1 - regression in selecting nested fields
2 participants