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

Add a query with WHERE clause to DataTypeTest #3540

Merged
merged 1 commit into from
Jun 16, 2020

Conversation

MiguelWeezardo
Copy link
Member

@MiguelWeezardo MiguelWeezardo commented Apr 24, 2020

This is useful for testing predicate pushdown.

Please note that this doesn't fail if predicate evaluation happens on Presto side, you still need an assertion that checks for that.

Fixes #496

@cla-bot cla-bot bot added the cla-signed label Apr 24, 2020
@findepi findepi self-requested a review April 24, 2020 19:35
@MiguelWeezardo MiguelWeezardo requested a review from findepi May 1, 2020 00:13
@MiguelWeezardo MiguelWeezardo force-pushed the test_with_pushdown branch 2 times, most recently from c868923 to 7e1e0b7 Compare May 1, 2020 15:16
@MiguelWeezardo MiguelWeezardo force-pushed the test_with_pushdown branch 9 times, most recently from 29882d4 to 8975a87 Compare June 9, 2020 14:18
@MiguelWeezardo
Copy link
Member Author

@findepi Could you give it another look and merge if it's OK? I'm not authorized for merge even for reviewed stuff.

Copy link
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

Minor comments, otherwise looks good. Please squash commits.

}
catch (RuntimeException e) {
log.error("Exception caught during query with merged WHERE clause, querying one column at a time", e);
debugTypes(prestoExecutor, session, expectedTypes, expectedResults, testTable);
Copy link
Member

Choose a reason for hiding this comment

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

What is an example failure from here?

Copy link
Member Author

Choose a reason for hiding this comment

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

2020-06-16T07:08:17.212-0500 INFO TIMELINE: Query 20200616_120817_00034_r86pt :: Transaction:[b059f772-d6bb-49d0-a4f0-3834a05593f9] :: elapsed 116ms :: planning 9ms :: waiting 59ms :: scheduling 66ms :: running 37ms :: finishing 4ms :: begin 2020-06-16T07:08:17.090-05:00 :: end 2020-06-16T07:08:17.206-05:00
2020-06-16T07:08:17.230-0500 INFO TIMELINE: Query 20200616_120817_00035_r86pt :: Transaction:[] :: elapsed 0ms :: planning 0ms :: waiting 0ms :: scheduling 0ms :: running 0ms :: finishing 0ms :: begin 2020-06-16T07:08:17.225-05:00 :: end 2020-06-16T07:08:17.225-05:00
2020-06-16T07:08:17.234-0500 SEVERE Exception caught during query with merged WHERE clause, querying one column at a time
2020-06-16T07:08:17.234-0500 INFO Querying input: 0 (expected type: json, expectedResult: null) using: SELECT col_0 FROM tpch.test_boolean_array_as_json_gnxml WHERE col_0 IS NOT DISTINCT FROM NULL
2020-06-16T07:08:17.356-0500 INFO Querying input: 1 (expected type: json, expectedResult: [[true,false],[false,true],[true,true]]) using: SELECT col_1 FROM tpch.test_boolean_array_as_json_gnxml WHERE col_1 IS NOT DISTINCT FROM ARRAY[ARRAY[true,false],ARRAY[false,true],ARRAY[true,true]]::boolean[]
2020-06-16T07:08:17.361-0500 INFO TIMELINE: Query 20200616_120817_00036_r86pt :: Transaction:[207a85f5-0bca-46d2-9318-69bb24515e96] :: elapsed 112ms :: planning 22ms :: waiting 41ms :: scheduling 59ms :: running 25ms :: finishing 6ms :: begin 2020-06-16T07:08:17.239-05:00 :: end 2020-06-16T07:08:17.351-05:00
2020-06-16T07:08:17.364-0500 INFO TIMELINE: Query 20200616_120817_00037_r86pt :: Transaction:[] :: elapsed 0ms :: planning 0ms :: waiting 0ms :: scheduling 0ms :: running 0ms :: finishing 0ms :: begin 2020-06-16T07:08:17.363-05:00 :: end 2020-06-16T07:08:17.363-05:00



java.lang.RuntimeException: line 1:149: mismatched input ':'. Expecting: '%', '*', '+', '-', '.', '/', 'AND', 'AT', 'EXCEPT', 'FETCH', 'GROUP', 'HAVING', 'INTERSECT', 'LIMIT', 'OFFSET', 'OR', 'ORDER', 'UNION', '[', '||', <EOF>

Copy link
Member Author

Choose a reason for hiding this comment

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

2020-06-16T07:08:59.077-0500 INFO TIMELINE: Query 20200616_120859_00286_r86pt :: Transaction:[7f93c7f9-d52c-4cf7-b66c-b96254412054] :: elapsed 70ms :: planning 5ms :: waiting 42ms :: scheduling 46ms :: running 17ms :: finishing 2ms :: begin 2020-06-16T07:08:59.003-05:00 :: end 2020-06-16T07:08:59.073-05:00
2020-06-16T07:08:59.417-0500 SEVERE Exception caught during query with merged WHERE clause, querying one column at a time
2020-06-16T07:08:59.417-0500 INFO Querying input: 0 (expected type: time, expectedResult: 01:12:34) using: SELECT col_0 FROM tpch.test_time_n5dm5 WHERE col_0 IS NOT DISTINCT FROM TIME '01:12:34.000'
2020-06-16T07:08:59.419-0500 INFO TIMELINE: Query 20200616_120859_00287_r86pt :: Transaction:[c7e9c592-4a0b-49d5-8eed-18eceb2e29cf] :: elapsed 335ms :: planning 266ms :: waiting 34ms :: scheduling 47ms :: running 20ms :: finishing 2ms :: begin 2020-06-16T07:08:59.079-05:00 :: end 2020-06-16T07:08:59.414-05:00
2020-06-16T07:08:59.532-0500 INFO Querying input: 1 (expected type: time, expectedResult: 02:12:34) using: SELECT col_1 FROM tpch.test_time_n5dm5 WHERE col_1 IS NOT DISTINCT FROM TIME '02:12:34.000'
2020-06-16T07:08:59.534-0500 INFO TIMELINE: Query 20200616_120859_00288_r86pt :: Transaction:[43d0f8b4-ae0c-42c9-8692-11349a9f61f6] :: elapsed 108ms :: planning 30ms :: waiting 39ms :: scheduling 45ms :: running 30ms :: finishing 3ms :: begin 2020-06-16T07:08:59.421-05:00 :: end 2020-06-16T07:08:59.529-05:00
2020-06-16T07:08:59.699-0500 INFO Querying input: 2 (expected type: time, expectedResult: 02:12:34.001) using: SELECT col_2 FROM tpch.test_time_n5dm5 WHERE col_2 IS NOT DISTINCT FROM TIME '02:12:34.001'
2020-06-16T07:08:59.717-0500 INFO TIMELINE: Query 20200616_120859_00289_r86pt :: Transaction:[23b56815-e738-4d94-b481-3d3b1ef0a165] :: elapsed 159ms :: planning 39ms :: waiting 60ms :: scheduling 68ms :: running 47ms :: finishing 5ms :: begin 2020-06-16T07:08:59.537-05:00 :: end 2020-06-16T07:08:59.696-05:00
2020-06-16T07:08:59.880-0500 INFO Querying input: 3 (expected type: time, expectedResult: 03:12:34) using: SELECT col_3 FROM tpch.test_time_n5dm5 WHERE col_3 IS NOT DISTINCT FROM TIME '03:12:34.000'
2020-06-16T07:08:59.883-0500 INFO TIMELINE: Query 20200616_120859_00290_r86pt :: Transaction:[d5623e99-0eae-43c7-bf91-f9c28c26b185] :: elapsed 173ms :: planning 35ms :: waiting 101ms :: scheduling 111ms :: running 24ms :: finishing 3ms :: begin 2020-06-16T07:08:59.703-05:00 :: end 2020-06-16T07:08:59.876-05:00
2020-06-16T07:09:00.078-0500 INFO Querying input: 4 (expected type: time, expectedResult: 04:12:34) using: SELECT col_4 FROM tpch.test_time_n5dm5 WHERE col_4 IS NOT DISTINCT FROM TIME '04:12:34.000'
2020-06-16T07:09:00.080-0500 INFO TIMELINE: Query 20200616_120859_00291_r86pt :: Transaction:[415b82d0-87fd-492c-ae4d-04d60c6b7f3e] :: elapsed 192ms :: planning 70ms :: waiting 88ms :: scheduling 96ms :: running 23ms :: finishing 3ms :: begin 2020-06-16T07:08:59.884-05:00 :: end 2020-06-16T07:09:00.076-05:00
2020-06-16T07:09:00.202-0500 INFO Querying input: 5 (expected type: time, expectedResult: 05:12:34) using: SELECT col_5 FROM tpch.test_time_n5dm5 WHERE col_5 IS NOT DISTINCT FROM TIME '05:12:34.000'
2020-06-16T07:09:00.205-0500 INFO TIMELINE: Query 20200616_120900_00292_r86pt :: Transaction:[884ab229-807b-46fa-9fce-09ee7bb00c4d] :: elapsed 117ms :: planning 36ms :: waiting 49ms :: scheduling 55ms :: running 23ms :: finishing 3ms :: begin 2020-06-16T07:09:00.082-05:00 :: end 2020-06-16T07:09:00.199-05:00
2020-06-16T07:09:00.307-0500 INFO Querying input: 6 (expected type: time, expectedResult: 06:12:34) using: SELECT col_6 FROM tpch.test_time_n5dm5 WHERE col_6 IS NOT DISTINCT FROM TIME '06:12:34.000'
2020-06-16T07:09:00.310-0500 INFO TIMELINE: Query 20200616_120900_00293_r86pt :: Transaction:[8f1324a2-1d51-4910-8646-838da5e6c1ad] :: elapsed 97ms :: planning 27ms :: waiting 39ms :: scheduling 45ms :: running 23ms :: finishing 2ms :: begin 2020-06-16T07:09:00.206-05:00 :: end 2020-06-16T07:09:00.303-05:00
2020-06-16T07:09:00.554-0500 INFO Querying input: 7 (expected type: time, expectedResult: 09:12:34) using: SELECT col_7 FROM tpch.test_time_n5dm5 WHERE col_7 IS NOT DISTINCT FROM TIME '09:12:34.000'
2020-06-16T07:09:00.555-0500 INFO TIMELINE: Query 20200616_120900_00294_r86pt :: Transaction:[426d50be-1124-4849-8a0c-823faa6122b5] :: elapsed 239ms :: planning 46ms :: waiting 93ms :: scheduling 105ms :: running 81ms :: finishing 7ms :: begin 2020-06-16T07:09:00.311-05:00 :: end 2020-06-16T07:09:00.550-05:00
2020-06-16T07:09:00.731-0500 INFO Querying input: 8 (expected type: time, expectedResult: 10:12:34) using: SELECT col_8 FROM tpch.test_time_n5dm5 WHERE col_8 IS NOT DISTINCT FROM TIME '10:12:34.000'
2020-06-16T07:09:00.733-0500 INFO TIMELINE: Query 20200616_120900_00295_r86pt :: Transaction:[886dc453-4684-4329-a44c-4ea747d59adb] :: elapsed 171ms :: planning 44ms :: waiting 87ms :: scheduling 97ms :: running 29ms :: finishing 1ms :: begin 2020-06-16T07:09:00.557-05:00 :: end 2020-06-16T07:09:00.728-05:00
2020-06-16T07:09:00.873-0500 INFO Querying input: 9 (expected type: time, expectedResult: 15:12:34.567) using: SELECT col_9 FROM tpch.test_time_n5dm5 WHERE col_9 IS NOT DISTINCT FROM TIME '15:12:34.567'
2020-06-16T07:09:00.874-0500 INFO TIMELINE: Query 20200616_120900_00296_r86pt :: Transaction:[460967fe-c61e-4785-aed8-c6e22b12cdad] :: elapsed 136ms :: planning 41ms :: waiting 61ms :: scheduling 68ms :: running 23ms :: finishing 4ms :: begin 2020-06-16T07:09:00.735-05:00 :: end 2020-06-16T07:09:00.871-05:00
2020-06-16T07:09:00.980-0500 INFO Querying input: 10 (expected type: time, expectedResult: 23:59:59.999) using: SELECT col_10 FROM tpch.test_time_n5dm5 WHERE col_10 IS NOT DISTINCT FROM TIME '23:59:59.999'
2020-06-16T07:09:00.981-0500 INFO TIMELINE: Query 20200616_120900_00297_r86pt :: Transaction:[3319649d-c205-4508-9d2b-871fdf91c115] :: elapsed 100ms :: planning 28ms :: waiting 40ms :: scheduling 49ms :: running 20ms :: finishing 3ms :: begin 2020-06-16T07:09:00.877-05:00 :: end 2020-06-16T07:09:00.977-05:00
2020-06-16T07:09:01.106-0500 INFO TIMELINE: Query 20200616_120900_00298_r86pt :: Transaction:[57e7653f-1238-4598-b261-635db6819186] :: elapsed 119ms :: planning 35ms :: waiting 50ms :: scheduling 57ms :: running 22ms :: finishing 5ms :: begin 2020-06-16T07:09:00.984-05:00 :: end 2020-06-16T07:09:01.103-05:00

This is useful for testing predicate pushdown.

Please note that this doesn't fail if predicate evaluation happens
on Presto side, you still need an assertion that checks for that.

Debug one column at a time if DataTypeTest fails on WHERE query

Add WHERE clause to queries in Postgres type tests
@findepi findepi merged commit d26aab9 into trinodb:master Jun 16, 2020
@findepi
Copy link
Member

findepi commented Jun 16, 2020

Merged, thanks!

@MiguelWeezardo MiguelWeezardo deleted the test_with_pushdown branch June 17, 2020 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Test predicate pushdown in JDBC connectors
2 participants