Commit Graph

8 Commits

Author SHA1 Message Date
Matthew Jacobs
38bc1c77b8 IMPALA-2375: Disabling/moving tests that don't work with the old HJ
Change-Id: I6d1d0d0edd3b60e854130c4d8b9fcbe765c1aba0
Reviewed-on: http://gerrit.cloudera.org:8080/1173
Reviewed-by: Dan Hecht <dhecht@cloudera.com>
Tested-by: Internal Jenkins
2015-10-07 14:47:40 -07:00
Alex Behm
c3b5edd2af IMPALA-2414: Fix correlated WITH-clause views.
The bug was that the analysis of a WITH-clause view containing a
relative table ref would register a collection-typed slot in the parent
tuple descriptor of that relative table ref. The problem is that we use
a dummy analyzer with a fresh global state for the WITH-clause analysis.
Since the descriptor table is part of the global state, it was possible
that we'd register a collection-typed slot with an item tuple id that was
the same as the parent tuple id (or another arbitrary tuple id that has
no meaning in the parent tuple). This parent/item tuple with the same id
lead to an infinite recursion in the backend.

The fix is to not register collection-typed slots in parent tuples when
analyzing a relative table ref inside a WITH-clause view. I added a new
flag to the analyzer to indicate whether it is analyzing a WITH-clause
view.

Change-Id: Ifc1bdebe4577a959aec1f6bb89a73eaa37562458
Reviewed-on: http://gerrit.cloudera.org:8080/1021
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: Internal Jenkins
2015-09-30 17:17:40 -07:00
Vlad Berindei
cfc3952a83 IMPALA-898: Support explicit column names in WITH-clause views.
Example:
WITH t(c1, c2) AS (SELECT int_col, bool_col FROM functional.alltypes)
SELECT * FROM t

This will create a local view with the 'int_col' and 'bool_col' columns labeled as 'c1'
and 'c2'. If the number of labels is less than the number of columns, then the remaining
columns in the local view will be labeled as the corresponding columns in the query
statement. Therefore, this is also a valid query (only 'int_col' will be labeled as
'c1'):

WITH t(c1) AS (SELECT int_col, bool_col FROM functional.alltypes)
SELECT * FROM t

Change-Id: Ie3a559ca9eaf95c6980c5695a49f02010c42899b
Reviewed-on: http://gerrit.cloudera.org:8080/717
Reviewed-by: Vlad Berindei <vlad.berindei@cloudera.com>
Tested-by: Internal Jenkins
2015-09-03 01:19:43 +00:00
Matthew Jacobs
164687ad81 IMPALA-1357: Analysis of WithClause pollutes global state
The analysis of a with clause should have its own global state so the
local view(s) can be analyzed without polluting the global state of the
parent QueryStmt. This might not always matter, but in a complex query
involving a with clause that contained a subquery, re-analysis of the
WithClause after the subquery rewrite resulted in an invalid Exists
conjunct being registered in the parent analyzer's global state. The
Exists conjunct was assigned to a scan node which then failed a
pre-condition check.

Change-Id: Ib020787b2e1ff202d96fe1b92bd9740897ab32a0
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4825
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: jenkins
(cherry picked from commit 629a8652c5a290054a8e582cc5cb5768a3ee67a8)
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5038
2014-10-30 16:50:00 -07:00
Dimitris Tsirogiannis
5a6f53db16 Add partition pruning tests
The following changes are included in this commit:
1. Modified the alltypesagg table to include an additional partition key
that has nulls.
2. Added a number of tests in hdfs.test that exercise the partition
pruning logic (see IMPALA-887).
3. Modified all the tests that are affected by the change in alltypesagg.

Change-Id: I1a769375aaa71273341522eb94490ba5e4c6f00d
Reviewed-on: http://gerrit.ent.cloudera.com:8080/2874
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3236
2014-06-24 02:14:27 -07:00
Matthew Jacobs
65353fd9fb IMPALA-598: Order by behavior for NULLs should be revisited
This change modifies that behavior of NULL ordering such that nulls always
compare greater than other values, but "nulls first" or "nulls last" can be used
to explicitly specify if nulls should be sorted first or last regardless of the
asc/desc.

Change-Id: I92feda1e7f42249de4009afd39f8395a0a32a2f8
Reviewed-on: http://gerrit.ent.cloudera.com:8080/812
Reviewed-by: Marcel Kornacker <marcel@cloudera.com>
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: Matthew Jacobs <mj@cloudera.com>
2014-01-08 10:53:48 -08:00
Alex Behm
8ad15fabcf IMPALA-372: Added CREATE/DROP/ALTER VIEW. 2014-01-08 10:51:35 -08:00
Alex Behm
045038e479 IMPALA-374: Added WITH clause without recursion. 2014-01-08 10:51:00 -08:00