Grokbase Groups Hive commits May 2013
FAQ
Author: gangtimliu
Date: Fri May 3 16:13:35 2013
New Revision: 1478856

URL: http://svn.apache.org/r1478856
Log:
HIVE-4474: Column access not tracked properly for partitioned tables. Samuel Yuan via Gang Tim Liu

Modified:
     hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnAccessAnalyzer.java
     hive/trunk/ql/src/test/queries/clientpositive/column_access_stats.q
     hive/trunk/ql/src/test/results/clientpositive/column_access_stats.q.out

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnAccessAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnAccessAnalyzer.java?rev=1478856&r1=1478855&r2=1478856&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnAccessAnalyzer.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnAccessAnalyzer.java Fri May 3 16:13:35 2013
@@ -44,7 +44,7 @@ public class ColumnAccessAnalyzer {
      for (TableScanOperator op : topOps.keySet()) {
        Table table = topOps.get(op);
        String tableName = table.getCompleteName();
- List<FieldSchema> tableCols = table.getAllCols();
+ List<FieldSchema> tableCols = table.getCols();
        for (int i : op.getNeededColumnIDs()) {
          columnAccessInfo.add(tableName, tableCols.get(i).getName());
        }

Modified: hive/trunk/ql/src/test/queries/clientpositive/column_access_stats.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/column_access_stats.q?rev=1478856&r1=1478855&r2=1478856&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/column_access_stats.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/column_access_stats.q Fri May 3 16:13:35 2013
@@ -8,11 +8,15 @@ LOAD DATA LOCAL INPATH '../data/files/T1

  CREATE TABLE T2(key STRING, val STRING) STORED AS TEXTFILE;
  CREATE TABLE T3(key STRING, val STRING) STORED AS TEXTFILE;
+CREATE TABLE T4(key STRING, val STRING) PARTITIONED BY (p STRING);

  -- Simple select queries
  SELECT key FROM T1 ORDER BY key;
  SELECT key, val FROM T1 ORDER BY key, val;
  SELECT 1 FROM T1;
+SELECT key, val from T4 where p=1;
+SELECT val FROM T4 where p=1;
+SELECT p, val FROM T4 where p=1;

  -- More complicated select queries
  EXPLAIN SELECT key FROM (SELECT key, val FROM T1) subq1 ORDER BY key;

Modified: hive/trunk/ql/src/test/results/clientpositive/column_access_stats.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/column_access_stats.q.out?rev=1478856&r1=1478855&r2=1478856&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/column_access_stats.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/column_access_stats.q.out Fri May 3 16:13:35 2013
@@ -9,6 +9,8 @@ PREHOOK: query: CREATE TABLE T2(key STRI
  PREHOOK: type: CREATETABLE
  PREHOOK: query: CREATE TABLE T3(key STRING, val STRING) STORED AS TEXTFILE
  PREHOOK: type: CREATETABLE
+PREHOOK: query: CREATE TABLE T4(key STRING, val STRING) PARTITIONED BY (p STRING)
+PREHOOK: type: CREATETABLE
  PREHOOK: query: -- Simple select queries
  SELECT key FROM T1 ORDER BY key
  PREHOOK: type: QUERY
@@ -46,6 +48,27 @@ PREHOOK: Input: default@t1
  1
  1
  1
+PREHOOK: query: SELECT key, val from T4 where p=1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t4
+#### A masked pattern was here ####
+Table:default@t4
+Columns:key,val
+
+PREHOOK: query: SELECT val FROM T4 where p=1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t4
+#### A masked pattern was here ####
+Table:default@t4
+Columns:val
+
+PREHOOK: query: SELECT p, val FROM T4 where p=1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t4
+#### A masked pattern was here ####
+Table:default@t4
+Columns:val
+
  PREHOOK: query: -- More complicated select queries
  EXPLAIN SELECT key FROM (SELECT key, val FROM T1) subq1 ORDER BY key
  PREHOOK: type: QUERY

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupcommits @
categorieshive, hadoop
postedMay 3, '13 at 4:13p
activeMay 3, '13 at 4:13p
posts1
users1
websitehive.apache.org

1 user in discussion

Gangtimliu: 1 post

People

Translate

site design / logo © 2021 Grokbase