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
[FLINK-34902][table] Fix IndexOutOfBoundsException for VALUES #24724
Conversation
abf08e9
to
13f15a4
Compare
@twalthr, would you mind taking a look at this? thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this so quickly.
@@ -63,6 +64,55 @@ void testInsertInto2() { | |||
.hasMessageContaining(" Number of columns must match number of query columns"); | |||
} | |||
|
|||
@Test | |||
void testInsertInto3() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests should have a descriptive name. E.g. testInsertIntoValuesColumnsMismatch
void testInsertInto7() { | ||
assertDoesNotThrow( | ||
() -> { | ||
plannerMocks.getParser().parse("INSERT INTO t2 (a,b) Select 1, 2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add a test for INSERT INTO t2 (a) VALUES (1), (3)
?
Hi @twalthr thanks a lot for your review. Could you please recheck in your available time? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jeyhunkarimov. LGTM
What is the purpose of the change
The purpose of this PR is to avoid wrong
IndexOutOfBoundsException
with Values.For example, a query
INSERT INTO t_3_columns (id, name, num) VALUES ('id_0', 'name_0', 5);
should not throw an exception.Brief change log
Verifying this change
org.apache.flink.table.planner.calcite. FlinkCalciteSqlValidatorTest
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation