impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Internal Jenkins (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-3938: Disallow implicit references between nested collections.
Date Sat, 27 Aug 2016 02:21:34 GMT
Internal Jenkins has submitted this change and it was merged.

Change subject: IMPALA-3938: Disallow implicit references between nested collections.
......................................................................


IMPALA-3938: Disallow implicit references between nested collections.

The Bug: Prior to this patch Impala would accept and execute a query of
the form "select pos, key, value from tbl.arr_map_col order by pos asc",
where "arr_map_col" is an array of map<?, ?>. In this example, the map
is not referenced as a collection and therefore the implicit rule of
using "item" should not be applied. The results produced from this
erroneous query are arbitrary. The semantically correct way of
expressing the query would be of the form "select a.pos, m.key, m.value
from tbl t, t.arr_map_col a, a.item m order by a.pos asc".

The Fix: Removed the existing 'expectExplicitMatch' flag to simplify the
code. During query analysis (more specifically: path resolution), if
part of a path cannot be explicitly matched then the planner will fall
back to an implicit field check. As part of this check, the type of the
nested field inside the collection will be inspected to verify that it
does not match that of a collection type. If so, the path resolution will
fail and an AnalysisException will be thrown indicating that the path
cannot be resolved. For example, trying to execute the query "select pos,
key, value from tbl.arr_map_col order by pos asc" would yield the
following error "Could not resolve column/field reference: 'key'".
Regarding test coverage, the existing test suite "AnalyzeStmtsTest" has
been augmented with a set of new tests that will verify that implicit
references between collections cannot be used.

Change-Id: I703c7e9c8c9c95c9fee714767367373eec10cd0c
Reviewed-on: http://gerrit.cloudera.org:8080/4079
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: Internal Jenkins
---
M fe/src/main/java/com/cloudera/impala/analysis/Path.java
M fe/src/test/java/com/cloudera/impala/analysis/AnalyzeStmtsTest.java
2 files changed, 45 insertions(+), 25 deletions(-)

Approvals:
  Internal Jenkins: Verified
  Alex Behm: Looks good to me, approved



-- 
To view, visit http://gerrit.cloudera.org:8080/4079
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I703c7e9c8c9c95c9fee714767367373eec10cd0c
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Christopher Channing <cchanning@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Christopher Channing <cchanning@cloudera.com>
Gerrit-Reviewer: Internal Jenkins

Mime
View raw message