Drop explicit ROW constructor from SELECTs #63
Closed
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.
Summary
Drop explicit
ROW(...)
constructor fromSELECT
s in SQL output.Details
Flink seems to choke on pipelines like
INSERT INTO ... SELECT ROW(HEADER.NAME) FROM FOO
. The Flink SQL parser is fine withROW(...)
but only if the expressions inside the constructor do not include a field access.
. Some experiments:SELECT ROW(HEADER) FROM FOO
👍SELECT ROW(HEADER.NAME) FROM FOO
👎SELECT (HEADER.NAME) FROM FOO
👍This seems like a bug to me, but the last case points to a workaround: we can simply drop the explicit
ROW
, and rely on the parser treating(...)
as the same thing.Testing
This was difficult to test, so I did so manually. The artificially complicated subscription
SELECT ROW("quantity") AS V, "product_id" AS KEY FROM INVENTORY."products_on_hand"
is rendered as follows:...whereas previously this would have been rendered with a
ROW(...)
constructor. The Flink parser seems to be happy with the change.