-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Disable incorrect pushdown in Mongo connector #3053
Conversation
Could you confirm the following CI failure?
|
806bd0c
to
6c1e7b5
Compare
@ebyhr thanks, updated |
CI failed -- #3049 |
47d5fa3
to
46e4b2d
Compare
CI failed -- checkout failed. This PR is cursed. |
0ce1962
to
547d117
Compare
Finally green. Please review. |
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.
Looks good modulo:
- improve commit message to mention that pushdown is disabled only for not supported types
- restore previous behaviour for types that are still supported
- test that exposes the bug that you are fixing
2372961
to
c59e746
Compare
it says "disable incorrect pushdown", not "disable pushdown" |
added test |
f9f3d57
to
11f6aa7
Compare
AC |
5555d0a
to
d126838
Compare
COL1 is of type BIGINT, so should not be used with varchar-typed domain. Add another varchar column.
@kokosing ready for re-review |
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 doing a test!
|
||
String tableName = "test_data_mapping_smoke_test_" + prestoTypeName.replaceAll("[^a-zA-Z0-9]", "_"); | ||
|
||
Runnable setup = () -> { |
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.
I think you might want to use io.prestosql.testing.sql.TestTable.randomTableSuffix
. Sometimes ATDQ is run in parallel for some connectors with several different configurations and then such test becomes flaky due table name conflict.
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.
Done
if (dataMappingTestSetup.isUnsupportedType()) { | ||
String typeNameBase = prestoTypeName.replaceFirst("\\(.*", ""); | ||
String expectedMessagePart = format("(%1$s.*not (yet )?supported)|((?i)unsupported.*%1$s)|((?i)not supported.*%1$s)", Pattern.quote(typeNameBase)); | ||
assertThatThrownBy(setup::run) |
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.
s/setup::run/setup?
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.
ThrowingCallable
is not assignable from Runnable
String createTable = format("CREATE TABLE %s(id bigint, value %s)", tableName, prestoTypeName); | ||
assertUpdate(createTable); | ||
assertUpdate( | ||
format("INSERT INTO %s VALUES (10000, NULL), (10001, %s), (99999, %s)", tableName, sampleValueLiteral, highValueLiteral), |
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.
10000 -> 1, 10001 -> 2, 99999 -> 3
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.
Why?
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.
That way it is a bit easier. It is just nit.
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.
IMO contrary -- 10001 or 99999 are easier to find than 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.
This depends on what you are optimizing for.
Fixes #1781