Zoltan Borok-Nagy
e6ca7ca14d
IMPALA-7108: IllegalStateException hit during CardinalityCheckNode.<init>
...
Since IMPALA-6314 on runtime scalar subqueries we set LIMIT 2
in StmtRewriter.mergeExpr(). We do that because later we add a
CardinalityCheckNode on top of such subqueries and with
LIMIT 2 we can still check if they return more than one row.
In the constructor of CardinalityCheckNode there is a
precondition that checks if the child node has LIMIT 2 to
be certain that we've set the limit for all the necessary
cases.
However, some subqueries will get a LIMIT 1 later breaking the
precondition in CardinalityCheckNode. An example to these
subqueries is a select stmt that selects from an inline view
that returns a single row:
select * from functional.alltypes
where int_col = (select f.id from (
select * from functional.alltypes limit 1) f);
Note that we shouldn't add a CardinalityCheckNode to the plan
of this query in the first place. To generate a proper plan I
updated SelectStmt.returnsSingleRow() because this method didn't
handle this case well.
I also changed
the precondition from
Preconditions.checkState(child.getLimit() == 2);
to
Preconditions.checkState(child.getLimit() <= 2);
in order to be more permissive.
I added tests for the aforementioned query.
Change-Id: I82a7a3fe26db3e12131c030c4ad055a9c4955407
Reviewed-on: http://gerrit.cloudera.org:8080/10605
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com >
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com >
2018-06-08 20:15:50 +00:00
..
2018-04-28 23:41:39 +00:00
2018-04-28 23:41:39 +00:00
2016-09-13 21:57:36 +00:00
2018-04-10 04:00:37 +00:00
2018-01-24 22:47:18 +00:00
2017-12-13 10:04:40 +00:00
2017-04-29 02:23:51 +00:00
2017-02-14 05:56:33 +00:00
2017-11-29 22:37:01 +00:00
2018-04-11 02:21:48 +00:00
2017-05-27 05:19:53 +00:00
2018-04-28 23:41:39 +00:00
2016-12-07 09:45:11 +00:00
2016-07-14 19:04:43 +00:00
2014-09-26 12:28:03 -07:00
2018-05-15 22:23:14 +00:00
2018-02-13 08:29:03 +00:00
2018-05-30 08:00:50 +00:00
2014-09-26 12:24:07 -07:00
2018-04-11 02:21:48 +00:00
2018-01-19 09:55:52 +00:00
2018-04-28 23:41:39 +00:00
2017-02-22 23:10:34 +00:00
2018-04-11 02:21:48 +00:00
2016-05-12 14:17:50 -07:00
2015-04-21 19:27:50 +00:00
2018-04-11 02:21:48 +00:00
2016-08-31 00:58:03 +00:00
2018-04-11 02:21:48 +00:00
2017-05-12 15:43:30 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2017-05-02 01:12:14 +00:00
2018-01-25 04:33:11 +00:00
2018-04-28 03:33:02 +00:00
2018-04-28 03:33:02 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2018-03-16 19:28:37 +00:00
2018-04-11 02:21:48 +00:00
2018-05-16 00:00:15 +00:00
2018-05-18 03:44:46 +00:00
2015-07-16 19:38:17 +00:00
2018-04-12 22:01:35 +00:00
2018-02-02 01:13:08 +00:00
2016-01-27 20:41:45 +00:00
2018-02-15 10:55:55 +00:00
2018-02-15 10:55:55 +00:00
2018-05-12 01:43:37 +00:00
2018-05-12 01:43:37 +00:00
2018-05-12 01:43:37 +00:00
2018-05-12 01:43:37 +00:00
2018-04-10 04:00:37 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2017-11-29 22:37:01 +00:00
2014-05-08 13:59:00 -07:00
2015-02-23 23:32:41 +00:00
2015-08-22 01:46:26 +00:00
2015-02-23 23:32:41 +00:00
2015-02-23 23:32:41 +00:00
2016-10-13 00:40:41 +00:00
2017-02-22 23:10:34 +00:00
2014-01-08 10:52:36 -08:00
2015-02-23 23:32:41 +00:00
2017-10-10 01:30:33 +00:00
2017-09-21 17:38:08 +00:00
2015-04-21 19:27:50 +00:00
2016-11-15 03:27:36 +00:00
2015-10-12 14:41:00 -07:00
2014-06-24 02:14:27 -07:00
2017-05-09 01:36:46 +00:00
2016-02-19 00:03:15 -08:00
2014-01-08 10:52:14 -08:00
2016-05-12 14:17:59 -07:00
2017-10-28 06:29:38 +00:00
2017-09-28 18:36:17 +00:00
2018-04-11 02:21:48 +00:00
2015-08-22 01:46:26 +00:00
2014-01-08 10:53:51 -08:00
2015-05-27 22:25:12 +00:00
2014-12-02 18:08:09 -08:00
2018-04-11 02:21:48 +00:00
2018-05-11 22:41:49 +00:00
2018-05-11 22:41:49 +00:00
2016-02-19 00:03:15 -08:00
2017-07-07 01:30:59 +00:00
2015-02-23 23:32:41 +00:00
2017-12-08 22:42:03 +00:00
2018-04-11 02:21:48 +00:00
2018-05-02 02:54:23 +00:00
2018-04-11 02:21:48 +00:00
2018-02-23 00:03:54 +00:00
2018-05-11 22:41:49 +00:00
2018-05-11 22:41:49 +00:00
2018-04-27 21:55:11 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2017-05-11 20:55:51 +00:00
2017-05-11 20:55:51 +00:00
2017-11-29 05:53:15 +00:00
2017-07-21 21:49:04 +00:00
2018-02-21 03:17:57 +00:00
2018-04-11 02:21:48 +00:00
2015-02-23 23:32:41 +00:00
2016-11-09 03:27:12 +00:00
2018-04-11 02:21:48 +00:00
2018-04-11 02:21:48 +00:00
2016-09-03 00:39:07 +00:00
2017-11-17 21:33:51 +00:00
2016-11-17 05:31:34 +00:00
2016-11-03 11:59:07 +00:00
2017-03-17 19:33:31 +00:00
2016-12-02 01:46:55 +00:00
2016-12-02 01:46:55 +00:00
2016-12-02 01:46:55 +00:00
2016-05-31 23:32:11 -07:00
2018-01-05 20:44:21 +00:00
2017-11-22 22:00:16 +00:00
2017-11-08 07:39:02 +00:00
2015-09-02 19:23:54 +00:00
2015-09-02 19:23:54 +00:00
2016-04-01 05:06:38 +00:00
2015-09-02 19:23:54 +00:00
2015-09-02 19:23:54 +00:00
2018-04-27 20:06:56 +00:00
2018-05-11 22:41:49 +00:00
2018-05-11 22:41:49 +00:00
2015-10-07 14:47:40 -07:00
2015-08-22 01:46:26 +00:00
2016-12-08 02:20:50 +00:00
2016-12-08 02:20:50 +00:00
2017-08-19 20:56:10 +00:00
2017-03-03 01:43:42 +00:00
2016-05-12 14:17:48 -07:00
2017-03-09 05:07:44 +00:00
2017-03-09 05:07:44 +00:00
2018-03-08 04:48:36 +00:00
2018-01-17 04:18:24 +00:00
2016-08-25 10:20:36 +00:00
2016-06-20 15:37:18 -07:00
2016-06-20 15:37:18 -07:00
2017-11-07 04:34:26 +00:00
2018-02-12 21:59:37 +00:00
2017-05-09 15:47:21 +00:00
2018-03-23 20:56:00 +00:00
2018-02-22 00:57:46 +00:00
2018-03-17 02:52:19 +00:00
2017-03-03 10:20:07 +00:00
2018-03-22 02:47:33 +00:00
2017-07-22 05:53:06 +00:00
2018-03-08 07:34:41 +00:00
2016-10-14 05:41:22 +00:00
2017-05-25 02:55:36 +00:00
2018-02-02 01:13:08 +00:00
2018-04-11 02:21:48 +00:00
2016-11-22 00:42:57 +00:00
2017-12-13 10:04:40 +00:00
2017-11-17 21:33:51 +00:00
2017-11-28 03:01:39 +00:00
2018-05-05 03:01:35 +00:00
2018-04-28 23:41:39 +00:00
2018-04-28 23:41:39 +00:00
2018-03-13 22:10:18 +00:00
2018-03-13 00:39:38 +00:00
2016-08-31 03:12:30 +00:00
2017-07-19 06:48:06 +00:00
2018-04-28 23:41:39 +00:00
2018-04-04 00:12:30 +00:00
2016-09-29 21:14:13 +00:00
2017-11-30 07:33:16 +00:00
2016-07-07 10:41:29 -07:00
2017-08-05 01:03:02 +00:00
2017-08-05 01:03:02 +00:00
2018-04-28 23:41:39 +00:00
2018-02-02 01:13:08 +00:00
2016-06-02 21:33:08 -07:00
2018-05-11 22:41:49 +00:00
2018-02-02 01:13:08 +00:00
2018-04-28 23:41:39 +00:00
2018-04-28 23:41:39 +00:00
2018-04-28 23:41:39 +00:00
2017-08-29 23:01:10 +00:00
2018-05-11 22:41:49 +00:00
2018-06-05 01:14:35 +00:00
2018-05-17 20:22:02 +00:00
2017-03-03 01:43:42 +00:00
2017-03-03 01:43:42 +00:00
2017-12-06 00:41:11 +00:00
2018-06-08 20:15:50 +00:00
2018-04-11 02:21:48 +00:00
2016-02-28 21:31:37 -08:00
2014-09-26 12:28:03 -07:00
2016-05-12 14:17:45 -07:00
2018-04-11 02:21:48 +00:00
2016-11-09 03:27:12 +00:00
2018-01-25 04:33:11 +00:00
2016-11-09 03:27:12 +00:00
2018-04-11 02:21:48 +00:00
2016-12-08 04:53:53 +00:00
2016-12-08 04:53:53 +00:00
2016-11-09 03:27:12 +00:00
2016-12-08 04:53:53 +00:00
2017-02-03 23:35:25 +00:00
2017-05-04 02:04:03 +00:00
2018-05-18 03:44:46 +00:00
2017-07-19 22:17:13 +00:00
2018-02-02 01:13:08 +00:00
2018-03-23 20:56:00 +00:00
2018-04-11 02:21:48 +00:00
2014-06-20 13:35:10 -07:00
2014-01-08 10:54:01 -08:00
2015-10-07 14:47:40 -07:00