hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nzh...@apache.org
Subject svn commit: r1153753 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/exec/StatsTask.java test/queries/clientpositive/stats16.q test/results/clientpositive/stats16.q.out
Date Thu, 04 Aug 2011 05:10:00 GMT
Author: nzhang
Date: Thu Aug  4 05:09:59 2011
New Revision: 1153753

URL: http://svn.apache.org/viewvc?rev=1153753&view=rev
Log:
HIVE-2343. stats are not updated for non "load table desc" operations" (Franklin Hu via Ning
Zhang)

Added:
    hive/trunk/ql/src/test/queries/clientpositive/stats16.q
    hive/trunk/ql/src/test/results/clientpositive/stats16.q.out
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java?rev=1153753&r1=1153752&r2=1153753&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java Thu Aug  4 05:09:59
2011
@@ -447,7 +447,8 @@ public class StatsTask extends Task<Stat
       if (value != null) {
         longValue = Long.parseLong(value);
 
-        if (!work.getLoadTableDesc().getReplace()) {
+        if (work.getLoadTableDesc() != null && 
+            !work.getLoadTableDesc().getReplace()) {
           String originalValue = parameters.get(statType);
           if (originalValue != null) {
             longValue += Long.parseLong(originalValue);

Added: hive/trunk/ql/src/test/queries/clientpositive/stats16.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/stats16.q?rev=1153753&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/stats16.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/stats16.q Thu Aug  4 05:09:59 2011
@@ -0,0 +1,12 @@
+set hive.stats.autogather=false;
+
+drop table stats16;
+
+create table stats16 (key int, value string);
+desc formatted stats16;
+
+insert into table stats16 select * from src;
+analyze table stats16 compute statistics;
+desc formatted stats16;
+
+drop table stats16;

Added: hive/trunk/ql/src/test/results/clientpositive/stats16.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/stats16.q.out?rev=1153753&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/stats16.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/stats16.q.out Thu Aug  4 05:09:59 2011
@@ -0,0 +1,108 @@
+PREHOOK: query: drop table stats16
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table stats16
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table stats16 (key int, value string)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table stats16 (key int, value string)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@stats16
+PREHOOK: query: desc formatted stats16
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: desc formatted stats16
+POSTHOOK: type: DESCTABLE
+# col_name            	data_type           	comment             
+	 	 
+key                 	int                 	None                
+value               	string              	None                
+	 	 
+# Detailed Table Information	 	 
+Database:           	default             	 
+Owner:              	franklin            	 
+CreateTime:         	Wed Aug 03 12:12:20 PDT 2011	 
+LastAccessTime:     	UNKNOWN             	 
+Protect Mode:       	None                	 
+Retention:          	0                   	 
+Location:           	pfile:/data/users/franklin/hive-stats/build/ql/test/data/warehouse/stats16
 
+Table Type:         	MANAGED_TABLE       	 
+Table Parameters:	 	 
+	transient_lastDdlTime	1312398740          
+	 	 
+# Storage Information	 	 
+SerDe Library:      	org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe	 
+InputFormat:        	org.apache.hadoop.mapred.TextInputFormat	 
+OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat	 
+Compressed:         	No                  	 
+Num Buckets:        	-1                  	 
+Bucket Columns:     	[]                  	 
+Sort Columns:       	[]                  	 
+Storage Desc Params:	 	 
+	serialization.format	1                   
+PREHOOK: query: insert into table stats16 select * from src
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@stats16
+POSTHOOK: query: insert into table stats16 select * from src
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@stats16
+POSTHOOK: Lineage: stats16.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: stats16.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+PREHOOK: query: analyze table stats16 compute statistics
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats16
+PREHOOK: Output: default@stats16
+POSTHOOK: query: analyze table stats16 compute statistics
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats16
+POSTHOOK: Output: default@stats16
+POSTHOOK: Lineage: stats16.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: stats16.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+PREHOOK: query: desc formatted stats16
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: desc formatted stats16
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Lineage: stats16.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: stats16.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]
+# col_name            	data_type           	comment             
+	 	 
+key                 	int                 	None                
+value               	string              	None                
+	 	 
+# Detailed Table Information	 	 
+Database:           	default             	 
+Owner:              	franklin            	 
+CreateTime:         	Wed Aug 03 12:12:20 PDT 2011	 
+LastAccessTime:     	UNKNOWN             	 
+Protect Mode:       	None                	 
+Retention:          	0                   	 
+Location:           	pfile:/data/users/franklin/hive-stats/build/ql/test/data/warehouse/stats16
 
+Table Type:         	MANAGED_TABLE       	 
+Table Parameters:	 	 
+	numFiles            	1                   
+	numPartitions       	0                   
+	numRows             	500                 
+	rawDataSize         	5312                
+	totalSize           	5812                
+	transient_lastDdlTime	1312398749          
+	 	 
+# Storage Information	 	 
+SerDe Library:      	org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe	 
+InputFormat:        	org.apache.hadoop.mapred.TextInputFormat	 
+OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat	 
+Compressed:         	No                  	 
+Num Buckets:        	-1                  	 
+Bucket Columns:     	[]                  	 
+Sort Columns:       	[]                  	 
+Storage Desc Params:	 	 
+	serialization.format	1                   
+PREHOOK: query: drop table stats16
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@stats16
+PREHOOK: Output: default@stats16
+POSTHOOK: query: drop table stats16
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@stats16
+POSTHOOK: Output: default@stats16
+POSTHOOK: Lineage: stats16.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: stats16.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default),
]



Mime
View raw message