hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1003588 - in /hadoop/hive/trunk: CHANGES.txt ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java ql/src/test/queries/clientpositive/create_1.q ql/src/test/results/clientpositive/create_1.q.out
Date Fri, 01 Oct 2010 17:12:23 GMT
Author: namit
Date: Fri Oct  1 17:12:22 2010
New Revision: 1003588

URL: http://svn.apache.org/viewvc?rev=1003588&view=rev
Log:
HIVE-1673 Create table bug causes the row format property lost when serde is specified
(He Yongqiang via namit)


Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_1.q
    hadoop/hive/trunk/ql/src/test/results/clientpositive/create_1.q.out

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=1003588&r1=1003587&r2=1003588&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Fri Oct  1 17:12:22 2010
@@ -315,6 +315,9 @@ Trunk -  Unreleased
     HIVE-1670 MapJoin throws an error if no column from the mapjoined table is selected
     (Ning Zhang via namit)
 
+    HIVE-1673 Create table bug causes the row format property lost when serde is specified
+    (He Yongqiang via namit)
+
   TESTS
 
     HIVE-1464. improve  test query performance

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java?rev=1003588&r1=1003587&r2=1003588&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java Fri Oct  1 17:12:22
2010
@@ -2301,40 +2301,6 @@ public class DDLTask extends Task<DDLWor
     }
     HiveStorageHandler storageHandler = tbl.getStorageHandler();
 
-    if (crtTbl.getSerName() != null) {
-      tbl.setSerializationLib(crtTbl.getSerName());
-    } else {
-      if (crtTbl.getFieldDelim() != null) {
-        tbl.setSerdeParam(Constants.FIELD_DELIM, crtTbl.getFieldDelim());
-        tbl.setSerdeParam(Constants.SERIALIZATION_FORMAT, crtTbl
-            .getFieldDelim());
-      }
-      if (crtTbl.getFieldEscape() != null) {
-        tbl.setSerdeParam(Constants.ESCAPE_CHAR, crtTbl.getFieldEscape());
-      }
-
-      if (crtTbl.getCollItemDelim() != null) {
-        tbl
-            .setSerdeParam(Constants.COLLECTION_DELIM, crtTbl
-            .getCollItemDelim());
-      }
-      if (crtTbl.getMapKeyDelim() != null) {
-        tbl.setSerdeParam(Constants.MAPKEY_DELIM, crtTbl.getMapKeyDelim());
-      }
-      if (crtTbl.getLineDelim() != null) {
-        tbl.setSerdeParam(Constants.LINE_DELIM, crtTbl.getLineDelim());
-      }
-    }
-
-    if (crtTbl.getSerdeProps() != null) {
-      Iterator<Entry<String, String>> iter = crtTbl.getSerdeProps().entrySet()
-        .iterator();
-      while (iter.hasNext()) {
-        Entry<String, String> m = iter.next();
-        tbl.setSerdeParam(m.getKey(), m.getValue());
-      }
-    }
-
     /*
      * We use LazySimpleSerDe by default.
      *
@@ -2354,6 +2320,34 @@ public class DDLTask extends Task<DDLWor
     } else {
       // let's validate that the serde exists
       validateSerDe(crtTbl.getSerName());
+      tbl.setSerializationLib(crtTbl.getSerName());
+    }
+    
+    if (crtTbl.getFieldDelim() != null) {
+      tbl.setSerdeParam(Constants.FIELD_DELIM, crtTbl.getFieldDelim());
+      tbl.setSerdeParam(Constants.SERIALIZATION_FORMAT, crtTbl.getFieldDelim());
+    }
+    if (crtTbl.getFieldEscape() != null) {
+      tbl.setSerdeParam(Constants.ESCAPE_CHAR, crtTbl.getFieldEscape());
+    }
+
+    if (crtTbl.getCollItemDelim() != null) {
+      tbl.setSerdeParam(Constants.COLLECTION_DELIM, crtTbl.getCollItemDelim());
+    }
+    if (crtTbl.getMapKeyDelim() != null) {
+      tbl.setSerdeParam(Constants.MAPKEY_DELIM, crtTbl.getMapKeyDelim());
+    }
+    if (crtTbl.getLineDelim() != null) {
+      tbl.setSerdeParam(Constants.LINE_DELIM, crtTbl.getLineDelim());
+    }
+
+    if (crtTbl.getSerdeProps() != null) {
+      Iterator<Entry<String, String>> iter = crtTbl.getSerdeProps().entrySet()
+        .iterator();
+      while (iter.hasNext()) {
+        Entry<String, String> m = iter.next();
+        tbl.setSerdeParam(m.getKey(), m.getValue());
+      }
     }
 
     if (crtTbl.getCols() != null) {

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_1.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_1.q?rev=1003588&r1=1003587&r2=1003588&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_1.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/create_1.q Fri Oct  1 17:12:22 2010
@@ -15,3 +15,15 @@ ROW FORMAT DELIMITED FIELDS TERMINATED B
 STORED AS TEXTFILE;
 DESCRIBE table3;
 DESCRIBE EXTENDED table3;
+
+CREATE TABLE table4 (a STRING, b STRING)
+ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
+STORED AS SEQUENCEFILE;
+DESCRIBE table4;
+DESCRIBE EXTENDED table4;
+
+CREATE TABLE table5 (a STRING, b STRING)
+ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
+STORED AS RCFILE;
+DESCRIBE table5;
+DESCRIBE EXTENDED table5;

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/create_1.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/create_1.q.out?rev=1003588&r1=1003587&r2=1003588&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/create_1.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/create_1.q.out Fri Oct  1 17:12:22
2010
@@ -22,15 +22,15 @@ b                   	string             
 	 	 
 # Detailed Table Information	 	 
 Database:           	default             	 
-Owner:              	thiruvel            	 
-CreateTime:         	Tue Sep 14 08:11:23 PDT 2010	 
+Owner:              	heyongqiang         	 
+CreateTime:         	Wed Sep 29 13:05:33 PDT 2010	 
 LastAccessTime:     	Wed Dec 31 16:00:00 PST 1969	 
 Protect Mode:       	None                	 
 Retention:          	0                   	 
-Location:           	pfile:/home/thiruvel/projects/hive/hive/build/ql/test/data/warehouse/table1
 
+Location:           	pfile:/Users/heyongqiang/Documents/workspace/Hive-2/build/ql/test/data/warehouse/table1
 
 Table Type:         	MANAGED_TABLE       	 
 Table Parameters:	 	 
-	transient_lastDdlTime	1284477083          
+	transient_lastDdlTime	1285790733          
 	 	 
 # Storage Information	 	 
 SerDe Library:      	org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe	 
@@ -71,15 +71,15 @@ b                   	int                
 	 	 
 # Detailed Table Information	 	 
 Database:           	default             	 
-Owner:              	thiruvel            	 
-CreateTime:         	Tue Sep 14 08:11:24 PDT 2010	 
+Owner:              	heyongqiang         	 
+CreateTime:         	Wed Sep 29 13:05:33 PDT 2010	 
 LastAccessTime:     	Wed Dec 31 16:00:00 PST 1969	 
 Protect Mode:       	None                	 
 Retention:          	0                   	 
-Location:           	pfile:/home/thiruvel/projects/hive/hive/build/ql/test/data/warehouse/table2
 
+Location:           	pfile:/Users/heyongqiang/Documents/workspace/Hive-2/build/ql/test/data/warehouse/table2
 
 Table Type:         	MANAGED_TABLE       	 
 Table Parameters:	 	 
-	transient_lastDdlTime	1284477084          
+	transient_lastDdlTime	1285790733          
 	 	 
 # Storage Information	 	 
 SerDe Library:      	org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe	 
@@ -120,15 +120,15 @@ b                   	string             
 	 	 
 # Detailed Table Information	 	 
 Database:           	default             	 
-Owner:              	thiruvel            	 
-CreateTime:         	Tue Sep 14 08:11:24 PDT 2010	 
+Owner:              	heyongqiang         	 
+CreateTime:         	Wed Sep 29 13:05:33 PDT 2010	 
 LastAccessTime:     	Wed Dec 31 16:00:00 PST 1969	 
 Protect Mode:       	None                	 
 Retention:          	0                   	 
-Location:           	pfile:/home/thiruvel/projects/hive/hive/build/ql/test/data/warehouse/table3
 
+Location:           	pfile:/Users/heyongqiang/Documents/workspace/Hive-2/build/ql/test/data/warehouse/table3
 
 Table Type:         	MANAGED_TABLE       	 
 Table Parameters:	 	 
-	transient_lastDdlTime	1284477084          
+	transient_lastDdlTime	1285790733          
 	 	 
 # Storage Information	 	 
 SerDe Library:      	org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe	 
@@ -142,3 +142,103 @@ Storage Desc Params:	 	 
 	serialization.format	\t                  
 	field.delim         	\t                  
 	 	 
+PREHOOK: query: CREATE TABLE table4 (a STRING, b STRING)
+ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
+STORED AS SEQUENCEFILE
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE table4 (a STRING, b STRING)
+ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
+STORED AS SEQUENCEFILE
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@table4
+PREHOOK: query: DESCRIBE table4
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: DESCRIBE table4
+POSTHOOK: type: DESCTABLE
+col_name            	data_type           	comment             
+	 	 
+a                   	string              	None                
+b                   	string              	None                
+PREHOOK: query: DESCRIBE EXTENDED table4
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: DESCRIBE EXTENDED table4
+POSTHOOK: type: DESCTABLE
+col_name            	data_type           	comment             
+	 	 
+a                   	string              	None                
+b                   	string              	None                
+	 	 
+# Detailed Table Information	 	 
+Database:           	default             	 
+Owner:              	heyongqiang         	 
+CreateTime:         	Wed Sep 29 13:05:34 PDT 2010	 
+LastAccessTime:     	Wed Dec 31 16:00:00 PST 1969	 
+Protect Mode:       	None                	 
+Retention:          	0                   	 
+Location:           	pfile:/Users/heyongqiang/Documents/workspace/Hive-2/build/ql/test/data/warehouse/table4
 
+Table Type:         	MANAGED_TABLE       	 
+Table Parameters:	 	 
+	transient_lastDdlTime	1285790734          
+	 	 
+# Storage Information	 	 
+SerDe Library:      	org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe	 
+InputFormat:        	org.apache.hadoop.mapred.SequenceFileInputFormat	 
+OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat	 
+Compressed:         	No                  	 
+Num Buckets:        	-1                  	 
+Bucket Columns:     	[]                  	 
+Sort Columns:       	[]                  	 
+Storage Desc Params:	 	 
+	serialization.format	\t                  
+	field.delim         	\t                  
+	 	 
+PREHOOK: query: CREATE TABLE table5 (a STRING, b STRING)
+ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
+STORED AS RCFILE
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: CREATE TABLE table5 (a STRING, b STRING)
+ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
+STORED AS RCFILE
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@table5
+PREHOOK: query: DESCRIBE table5
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: DESCRIBE table5
+POSTHOOK: type: DESCTABLE
+col_name            	data_type           	comment             
+	 	 
+a                   	string              	from deserializer   
+b                   	string              	from deserializer   
+PREHOOK: query: DESCRIBE EXTENDED table5
+PREHOOK: type: DESCTABLE
+POSTHOOK: query: DESCRIBE EXTENDED table5
+POSTHOOK: type: DESCTABLE
+col_name            	data_type           	comment             
+	 	 
+a                   	string              	from deserializer   
+b                   	string              	from deserializer   
+	 	 
+# Detailed Table Information	 	 
+Database:           	default             	 
+Owner:              	heyongqiang         	 
+CreateTime:         	Wed Sep 29 13:05:34 PDT 2010	 
+LastAccessTime:     	Wed Dec 31 16:00:00 PST 1969	 
+Protect Mode:       	None                	 
+Retention:          	0                   	 
+Location:           	pfile:/Users/heyongqiang/Documents/workspace/Hive-2/build/ql/test/data/warehouse/table5
 
+Table Type:         	MANAGED_TABLE       	 
+Table Parameters:	 	 
+	transient_lastDdlTime	1285790734          
+	 	 
+# Storage Information	 	 
+SerDe Library:      	org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe	 
+InputFormat:        	org.apache.hadoop.hive.ql.io.RCFileInputFormat	 
+OutputFormat:       	org.apache.hadoop.hive.ql.io.RCFileOutputFormat	 
+Compressed:         	No                  	 
+Num Buckets:        	-1                  	 
+Bucket Columns:     	[]                  	 
+Sort Columns:       	[]                  	 
+Storage Desc Params:	 	 
+	serialization.format	\t                  
+	field.delim         	\t                  
+	 	 



Mime
View raw message