diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java index 8d58201..1ade556 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java @@ -316,8 +316,8 @@ public class DDLTask extends Task implements Serializable { crtIndex.getTableName(), crtIndex.getIndexName(), crtIndex.getIndexTypeHandlerClass(), crtIndex.getIndexedCols(), crtIndex.getIndexTableName(), crtIndex.getDeferredRebuild(), crtIndex.getInputFormat(), crtIndex.getOutputFormat(), crtIndex.getSerde(), - crtIndex.getStorageHandler(), crtIndex.getLocation(), crtIndex.getIdxProps(), crtIndex.getSerdeProps(), - crtIndex.getCollItemDelim(), crtIndex.getFieldDelim(), crtIndex.getFieldEscape(), + crtIndex.getStorageHandler(), crtIndex.getLocation(), crtIndex.getIdxProps(), crtIndex.getTblProps(), + crtIndex.getSerdeProps(), crtIndex.getCollItemDelim(), crtIndex.getFieldDelim(), crtIndex.getFieldEscape(), crtIndex.getLineDelim(), crtIndex.getMapKeyDelim() ); return 0; diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index 1a2b8f8..5be41d8 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -446,7 +446,7 @@ public class Hive { List indexedCols, String indexTblName, boolean deferredRebuild, String inputFormat, String outputFormat, String serde, String storageHandler, String location, - Map idxProps, Map serdeProps, + Map idxProps, Map tblProps, Map serdeProps, String collItemDelim, String fieldDelim, String fieldEscape, String lineDelim, String mapKeyDelim) throws HiveException { @@ -558,6 +558,11 @@ public class Hive { List partKeys = baseTbl.getPartitionKeys(); tt.setPartitionKeys(partKeys); tt.setTableType(TableType.INDEX_TABLE.toString()); + if (tblProps != null) { + for (Entry prop : tblProps.entrySet()) { + tt.putToParameters(prop.getKey(), prop.getValue()); + } + } } if(!deferredRebuild) { @@ -568,6 +573,11 @@ public class Hive { storageDescriptor, params, deferredRebuild); indexHandler.analyzeIndexDefinition(baseTbl, indexDesc, tt); + if (idxProps != null) + { + indexDesc.getParameters().putAll(idxProps); + } + this.getMSC().createIndex(indexDesc, tt); } catch (Exception e) { diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java index da26853..034f571 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java @@ -228,7 +228,9 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { } else if (ast.getToken().getType() == HiveParser.TOK_ALTERTABLE_CLUSTER_SORT) { analyzeAlterTableClusterSort(ast); } else if (ast.getToken().getType() == HiveParser.TOK_ALTERINDEX_REBUILD) { - analyzeUpdateIndex(ast); + analyzeAlterIndexRebuild(ast); + } else if (ast.getToken().getType() == HiveParser.TOK_ALTERINDEX_PROPERTIES) { + analyzeAlterIndexProps(ast); } else if (ast.getToken().getType() == HiveParser.TOK_SHOWPARTITIONS) { ctx.setResFile(new Path(ctx.getLocalTmpFileURI())); analyzeShowPartitions(ast); @@ -336,6 +338,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { String indexTableName = null; boolean deferredRebuild = false; String location = null; + Map tblProps = null; Map idxProps = null; RowFormatParams rowFormatParams = new RowFormatParams(); @@ -362,6 +365,9 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { location = unescapeSQLString(child.getChild(0).getText()); break; case HiveParser.TOK_TABLEPROPERTIES: + tblProps = DDLSemanticAnalyzer.getProps((ASTNode) child.getChild(0)); + break; + case HiveParser.TOK_INDEXPROPERTIES: idxProps = DDLSemanticAnalyzer.getProps((ASTNode) child.getChild(0)); break; case HiveParser.TOK_TABLESERIALIZER: @@ -379,7 +385,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { CreateIndexDesc crtIndexDesc = new CreateIndexDesc(tableName, indexName, indexedCols, indexTableName, deferredRebuild, storageFormat.inputFormat, storageFormat.outputFormat, - storageFormat.storageHandler, typeName, location, idxProps, + storageFormat.storageHandler, typeName, location, idxProps, tblProps, shared.serde, shared.serdeProps, rowFormatParams.collItemDelim, rowFormatParams.fieldDelim, rowFormatParams.fieldEscape, rowFormatParams.lineDelim, rowFormatParams.mapKeyDelim); @@ -395,7 +401,7 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { dropIdxDesc), conf)); } - private void analyzeUpdateIndex(ASTNode ast) throws SemanticException { + private void analyzeAlterIndexRebuild(ASTNode ast) throws SemanticException { String baseTableName = unescapeIdentifier(ast.getChild(0).getText()); String indexName = unescapeIdentifier(ast.getChild(1).getText()); HashMap partSpec = null; @@ -407,6 +413,17 @@ public class DDLSemanticAnalyzer extends BaseSemanticAnalyzer { rootTasks.addAll(indexBuilder); } + private void analyzeAlterIndexProps(ASTNode ast) + throws SemanticException { + + String baseTableName = unescapeIdentifier(ast.getChild(0).getText()); + String indexName = unescapeIdentifier(ast.getChild(1).getText()); + HashMap mapProp = getProps((ASTNode) (ast.getChild(2)) + .getChild(0)); + + // Stub for alter index properties + } + private List> getIndexBuilderMapRed(String baseTableName, String indexName, HashMap partSpec) throws SemanticException { try { diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g index f61cb51..ed8ebaf 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g +++ ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g @@ -4,7 +4,7 @@ options { output=AST; ASTLabelType=CommonTree; -backtrack=false; +backtrack=true; k=3; } @@ -115,6 +115,7 @@ TOK_ALTERTABLE_LOCATION; TOK_ALTERTABLE_PROPERTIES; TOK_ALTERTABLE_CHANGECOL_AFTER_POSITION; TOK_ALTERINDEX_REBUILD; +TOK_ALTERINDEX_PROPERTIES; TOK_MSCK; TOK_SHOWDATABASES; TOK_SHOWTABLES; @@ -167,6 +168,8 @@ TOK_EXPLAIN; TOK_TABLESERIALIZER; TOK_TABLEPROPERTIES; TOK_TABLEPROPLIST; +TOK_INDEXPROPERTIES; +TOK_INDEXPROPLIST; TOK_TABTYPE; TOK_LIMIT; TOK_TABLEPROPERTY; @@ -251,7 +254,6 @@ ddlStatement | createFunctionStatement | createIndexStatement | dropIndexStatement - | alterIndexRebuild | dropFunctionStatement | analyzeStatement | lockStatement @@ -341,16 +343,20 @@ createIndexStatement KW_ON KW_TABLE tab=Identifier LPAREN indexedCols=columnNameList RPAREN KW_AS typeName=StringLiteral autoRebuild? + indexPropertiesPrefixed? indexTblName? tableRowFormat? tableFileFormat? tableLocation? + tablePropertiesPrefixed? ->^(TOK_CREATEINDEX $indexName $typeName $tab $indexedCols autoRebuild? + indexPropertiesPrefixed? indexTblName? tableRowFormat? tableFileFormat? - tableLocation?) + tableLocation? + tablePropertiesPrefixed?) ; autoRebuild @@ -375,10 +381,17 @@ indexPropertiesPrefixed ; indexProperties -@init { msgs.push("table properties"); } +@init { msgs.push("index properties"); } @after { msgs.pop(); } : - LPAREN propertiesList RPAREN -> ^(TOK_TABLEPROPERTIES propertiesList) + LPAREN indexPropertiesList RPAREN -> ^(TOK_INDEXPROPERTIES indexPropertiesList) + ; + +indexPropertiesList +@init { msgs.push("index properties list"); } +@after { msgs.pop(); } + : + keyValueProperty (COMMA keyValueProperty)* -> ^(TOK_INDEXPROPLIST keyValueProperty+) ; dropIndexStatement @@ -402,6 +415,8 @@ alterStatement KW_TABLE! alterTableStatementSuffix | KW_VIEW! alterViewStatementSuffix + | + KW_INDEX! alterIndexStatementSuffix ) ; @@ -428,6 +443,13 @@ alterViewStatementSuffix : alterViewSuffixProperties ; +alterIndexStatementSuffix +@init { msgs.push("alter index statement"); } +@after { msgs.pop(); } + : alterIndexRebuild + | alterIndexProperties + ; + alterStatementSuffixRename @init { msgs.push("rename statement"); } @after { msgs.pop(); } @@ -593,8 +615,22 @@ alterStatementSuffixClusterbySortby alterIndexRebuild @init { msgs.push("update index statement");} @after {msgs.pop();} - : KW_ALTER KW_INDEX indexName=Identifier KW_ON base_table_name=Identifier partitionSpec? KW_REBUILD - ->^(TOK_ALTERINDEX_REBUILD $base_table_name $indexName partitionSpec?) + : indexName=Identifier + (KW_ON tableName=Identifier) + partitionSpec? + KW_REBUILD + ->^(TOK_ALTERINDEX_REBUILD $tableName $indexName partitionSpec?) + ; + +alterIndexProperties +@init { msgs.push("update index statement");} +@after {msgs.pop();} + : indexName=Identifier + (KW_ON tableName=Identifier) + partitionSpec? + KW_SET KW_IDXPROPERTIES + indexProperties + ->^(TOK_ALTERINDEX_PROPERTIES $tableName $indexName partitionSpec? indexProperties) ; fileFormat @@ -797,11 +833,11 @@ tableProperties @init { msgs.push("table properties"); } @after { msgs.pop(); } : - LPAREN propertiesList RPAREN -> ^(TOK_TABLEPROPERTIES propertiesList) + LPAREN tablePropertiesList RPAREN -> ^(TOK_TABLEPROPERTIES tablePropertiesList) ; -propertiesList -@init { msgs.push("properties list"); } +tablePropertiesList +@init { msgs.push("table properties list"); } @after { msgs.pop(); } : keyValueProperty (COMMA keyValueProperty)* -> ^(TOK_TABLEPROPLIST keyValueProperty+) @@ -1844,7 +1880,7 @@ KW_SERDEPROPERTIES: 'SERDEPROPERTIES'; KW_LIMIT: 'LIMIT'; KW_SET: 'SET'; KW_TBLPROPERTIES: 'TBLPROPERTIES'; -KW_IDXPROPERTIES: 'INDEXPROPERTIES'; +KW_IDXPROPERTIES: 'IDXPROPERTIES'; KW_VALUE_TYPE: '$VALUE$'; KW_ELEM_TYPE: '$ELEM$'; KW_CASE: 'CASE'; diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java index 3b78d25..52c6ce8 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java @@ -55,6 +55,8 @@ public final class SemanticAnalyzerFactory { commandType.put(HiveParser.TOK_ALTERTABLE_PROPERTIES, "ALTERTABLE_PROPERTIES"); commandType.put(HiveParser.TOK_ALTERTABLE_SERIALIZER, "ALTERTABLE_SERIALIZER"); commandType.put(HiveParser.TOK_ALTERTABLE_SERDEPROPERTIES, "ALTERTABLE_SERDEPROPERTIES"); + commandType.put(HiveParser.TOK_ALTERINDEX_REBUILD, "ALTERINDEX_REBUILD"); + commandType.put(HiveParser.TOK_ALTERINDEX_PROPERTIES, "ALTERINDEX_PROPS"); commandType.put(HiveParser.TOK_SHOWDATABASES, "SHOWDATABASES"); commandType.put(HiveParser.TOK_SHOWTABLES, "SHOWTABLES"); commandType.put(HiveParser.TOK_SHOW_TABLESTATUS, "SHOW_TABLESTATUS"); @@ -67,7 +69,6 @@ public final class SemanticAnalyzerFactory { commandType.put(HiveParser.TOK_DROPVIEW, "DROPVIEW"); commandType.put(HiveParser.TOK_CREATEINDEX, "CREATEINDEX"); commandType.put(HiveParser.TOK_DROPINDEX, "DROPINDEX"); - commandType.put(HiveParser.TOK_ALTERINDEX_REBUILD, "ALTERINDEX_REBUILD"); commandType.put(HiveParser.TOK_ALTERVIEW_PROPERTIES, "ALTERVIEW_PROPERTIES"); commandType.put(HiveParser.TOK_QUERY, "QUERY"); commandType.put(HiveParser.TOK_LOCKTABLE, "LOCKTABLE"); @@ -114,6 +115,7 @@ public final class SemanticAnalyzerFactory { case HiveParser.TOK_ALTERTABLE_SERIALIZER: case HiveParser.TOK_ALTERTABLE_SERDEPROPERTIES: case HiveParser.TOK_ALTERINDEX_REBUILD: + case HiveParser.TOK_ALTERINDEX_PROPERTIES: case HiveParser.TOK_ALTERVIEW_PROPERTIES: case HiveParser.TOK_SHOWDATABASES: case HiveParser.TOK_SHOWTABLES: diff --git ql/src/java/org/apache/hadoop/hive/ql/plan/CreateIndexDesc.java ql/src/java/org/apache/hadoop/hive/ql/plan/CreateIndexDesc.java index 2625d6e..eb9f453 100644 --- ql/src/java/org/apache/hadoop/hive/ql/plan/CreateIndexDesc.java +++ ql/src/java/org/apache/hadoop/hive/ql/plan/CreateIndexDesc.java @@ -40,13 +40,14 @@ public class CreateIndexDesc extends DDLDesc implements Serializable { String indexTypeHandlerClass; String location; Map idxProps; + Map tblProps; Map serdeProps; String collItemDelim; String fieldDelim; String fieldEscape; String lineDelim; String mapKeyDelim; - + public CreateIndexDesc() { super(); @@ -55,7 +56,7 @@ public class CreateIndexDesc extends DDLDesc implements Serializable { public CreateIndexDesc(String tableName, String indexName, List indexedCols, String indexTableName, boolean deferredRebuild, String inputFormat, String outputFormat, String storageHandler, - String typeName, String location, Map idxProps, + String typeName, String location, Map idxProps, Map tblProps, String serde, Map serdeProps, String collItemDelim, String fieldDelim, String fieldEscape, String lineDelim, String mapKeyDelim) { @@ -72,6 +73,7 @@ public class CreateIndexDesc extends DDLDesc implements Serializable { this.indexTypeHandlerClass = typeName; this.location = location; this.idxProps = idxProps; + this.tblProps = tblProps; this.serde = serde; this.serdeProps = serdeProps; this.collItemDelim = collItemDelim; @@ -104,7 +106,7 @@ public class CreateIndexDesc extends DDLDesc implements Serializable { public void setIndexedCols(List indexedCols) { this.indexedCols = indexedCols; } - + public String getIndexTableName() { return indexTableName; } @@ -112,11 +114,11 @@ public class CreateIndexDesc extends DDLDesc implements Serializable { public void setIndexTableName(String indexTableName) { this.indexTableName = indexTableName; } - + public boolean isDeferredRebuild() { return deferredRebuild; } - + public boolean getDeferredRebuild() { return deferredRebuild; } @@ -173,6 +175,14 @@ public class CreateIndexDesc extends DDLDesc implements Serializable { this.idxProps = idxProps; } + public Map getTblProps() { + return tblProps; + } + + public void setTblProps(Map tblProps) { + this.tblProps = tblProps; + } + public Map getSerdeProps() { return serdeProps; } @@ -220,7 +230,7 @@ public class CreateIndexDesc extends DDLDesc implements Serializable { public void setMapKeyDelim(String mapKeyDelim) { this.mapKeyDelim = mapKeyDelim; } - + public String getIndexTypeHandlerClass() { return indexTypeHandlerClass; } diff --git ql/src/test/queries/clientpositive/index_creation.q ql/src/test/queries/clientpositive/index_creation.q index 33f3576..3b63436 100644 --- ql/src/test/queries/clientpositive/index_creation.q +++ ql/src/test/queries/clientpositive/index_creation.q @@ -4,6 +4,8 @@ drop index src_index_4 on src; drop index src_index_5 on src; drop index src_index_6 on src; drop index src_index_7 on src; +drop index src_index_8 on src; +drop index src_index_9 on src; create index src_index_2 on table src(key) as 'compact' WITH DEFERRED REBUILD; desc extended default__src_src_index_2__; @@ -23,11 +25,19 @@ desc extended default__src_src_index_6__; create index src_index_7 on table src(key) as 'compact' WITH DEFERRED REBUILD in table src_idx_src_index_7 STORED AS RCFILE; desc extended src_idx_src_index_7; +create index src_index_8 on table src(key) as 'compact' WITH DEFERRED REBUILD IDXPROPERTIES ("prop1"="val1", "prop2"="val2"); +desc extended default__src_src_index_8__; + +create index src_index_9 on table src(key) as 'compact' WITH DEFERRED REBUILD TBLPROPERTIES ("prop1"="val1", "prop2"="val2"); +desc extended default__src_src_index_9__; + drop index src_index_2 on src; drop index src_index_3 on src; drop index src_index_4 on src; drop index src_index_5 on src; drop index src_index_6 on src; drop index src_index_7 on src; +drop index src_index_8 on src; +drop index src_index_9 on src; show tables; diff --git ql/src/test/results/clientpositive/index_creation.q.out ql/src/test/results/clientpositive/index_creation.q.out index cc697c6..47c0e61 100644 --- ql/src/test/results/clientpositive/index_creation.q.out +++ ql/src/test/results/clientpositive/index_creation.q.out @@ -22,6 +22,14 @@ PREHOOK: query: drop index src_index_7 on src PREHOOK: type: DROPINDEX POSTHOOK: query: drop index src_index_7 on src POSTHOOK: type: DROPINDEX +PREHOOK: query: drop index src_index_8 on src +PREHOOK: type: DROPINDEX +POSTHOOK: query: drop index src_index_8 on src +POSTHOOK: type: DROPINDEX +PREHOOK: query: drop index src_index_9 on src +PREHOOK: type: DROPINDEX +POSTHOOK: query: drop index src_index_9 on src +POSTHOOK: type: DROPINDEX PREHOOK: query: create index src_index_2 on table src(key) as 'compact' WITH DEFERRED REBUILD PREHOOK: type: CREATEINDEX POSTHOOK: query: create index src_index_2 on table src(key) as 'compact' WITH DEFERRED REBUILD @@ -34,7 +42,7 @@ key string default _bucketname string _offsets array -Detailed Table Information Table(tableName:default__src_src_index_2__, dbName:default, owner:null, createTime:1286799495, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/thiruvel/projects/hive/hive.unsecure/build/ql/test/data/warehouse/default__src_src_index_2__, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1286799495}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) +Detailed Table Information Table(tableName:default__src_src_index_2__, dbName:default, owner:null, createTime:1287802294, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/mwang/Projects/hive/build/ql/test/data/warehouse/default__src_src_index_2__, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1287802294}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) PREHOOK: query: create index src_index_3 on table src(key) as 'compact' WITH DEFERRED REBUILD in table src_idx_src_index_3 PREHOOK: type: CREATEINDEX POSTHOOK: query: create index src_index_3 on table src(key) as 'compact' WITH DEFERRED REBUILD in table src_idx_src_index_3 @@ -47,7 +55,7 @@ key string default _bucketname string _offsets array -Detailed Table Information Table(tableName:src_idx_src_index_3, dbName:default, owner:null, createTime:1286799495, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/thiruvel/projects/hive/hive.unsecure/build/ql/test/data/warehouse/src_idx_src_index_3, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1286799495}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) +Detailed Table Information Table(tableName:src_idx_src_index_3, dbName:default, owner:null, createTime:1287802295, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/mwang/Projects/hive/build/ql/test/data/warehouse/src_idx_src_index_3, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1287802295}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) PREHOOK: query: create index src_index_4 on table src(key) as 'compact' WITH DEFERRED REBUILD ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' STORED AS TEXTFILE PREHOOK: type: CREATEINDEX POSTHOOK: query: create index src_index_4 on table src(key) as 'compact' WITH DEFERRED REBUILD ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' STORED AS TEXTFILE @@ -60,7 +68,7 @@ key string default _bucketname string _offsets array -Detailed Table Information Table(tableName:default__src_src_index_4__, dbName:default, owner:null, createTime:1286799495, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/thiruvel/projects/hive/hive.unsecure/build/ql/test/data/warehouse/default__src_src_index_4__, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format= , field.delim= +Detailed Table Information Table(tableName:default__src_src_index_4__, dbName:default, owner:null, createTime:1287802295, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/mwang/Projects/hive/build/ql/test/data/warehouse/default__src_src_index_4__, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format= , field.delim= PREHOOK: query: create index src_index_5 on table src(key) as 'compact' WITH DEFERRED REBUILD ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' ESCAPED BY '\\' PREHOOK: type: CREATEINDEX POSTHOOK: query: create index src_index_5 on table src(key) as 'compact' WITH DEFERRED REBUILD ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' ESCAPED BY '\\' @@ -73,7 +81,7 @@ key string default _bucketname string _offsets array -Detailed Table Information Table(tableName:default__src_src_index_5__, dbName:default, owner:null, createTime:1286799495, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/thiruvel/projects/hive/hive.unsecure/build/ql/test/data/warehouse/default__src_src_index_5__, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{escape.delim=\, serialization.format= , field.delim= +Detailed Table Information Table(tableName:default__src_src_index_5__, dbName:default, owner:null, createTime:1287802295, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/mwang/Projects/hive/build/ql/test/data/warehouse/default__src_src_index_5__, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{escape.delim=\, serialization.format= , field.delim= PREHOOK: query: create index src_index_6 on table src(key) as 'compact' WITH DEFERRED REBUILD STORED AS RCFILE PREHOOK: type: CREATEINDEX POSTHOOK: query: create index src_index_6 on table src(key) as 'compact' WITH DEFERRED REBUILD STORED AS RCFILE @@ -86,7 +94,7 @@ key string from deserializer _bucketname string from deserializer _offsets array from deserializer -Detailed Table Information Table(tableName:default__src_src_index_6__, dbName:default, owner:null, createTime:1286799495, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/thiruvel/projects/hive/hive.unsecure/build/ql/test/data/warehouse/default__src_src_index_6__, inputFormat:org.apache.hadoop.hive.ql.io.RCFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.RCFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1286799495}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) +Detailed Table Information Table(tableName:default__src_src_index_6__, dbName:default, owner:null, createTime:1287802296, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/mwang/Projects/hive/build/ql/test/data/warehouse/default__src_src_index_6__, inputFormat:org.apache.hadoop.hive.ql.io.RCFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.RCFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1287802296}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) PREHOOK: query: create index src_index_7 on table src(key) as 'compact' WITH DEFERRED REBUILD in table src_idx_src_index_7 STORED AS RCFILE PREHOOK: type: CREATEINDEX POSTHOOK: query: create index src_index_7 on table src(key) as 'compact' WITH DEFERRED REBUILD in table src_idx_src_index_7 STORED AS RCFILE @@ -99,7 +107,33 @@ key string from deserializer _bucketname string from deserializer _offsets array from deserializer -Detailed Table Information Table(tableName:src_idx_src_index_7, dbName:default, owner:null, createTime:1286799495, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/thiruvel/projects/hive/hive.unsecure/build/ql/test/data/warehouse/src_idx_src_index_7, inputFormat:org.apache.hadoop.hive.ql.io.RCFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.RCFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1286799495}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) +Detailed Table Information Table(tableName:src_idx_src_index_7, dbName:default, owner:null, createTime:1287802296, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/mwang/Projects/hive/build/ql/test/data/warehouse/src_idx_src_index_7, inputFormat:org.apache.hadoop.hive.ql.io.RCFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.RCFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1287802296}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) +PREHOOK: query: create index src_index_8 on table src(key) as 'compact' WITH DEFERRED REBUILD IDXPROPERTIES ("prop1"="val1", "prop2"="val2") +PREHOOK: type: CREATEINDEX +POSTHOOK: query: create index src_index_8 on table src(key) as 'compact' WITH DEFERRED REBUILD IDXPROPERTIES ("prop1"="val1", "prop2"="val2") +POSTHOOK: type: CREATEINDEX +PREHOOK: query: desc extended default__src_src_index_8__ +PREHOOK: type: DESCTABLE +POSTHOOK: query: desc extended default__src_src_index_8__ +POSTHOOK: type: DESCTABLE +key string default +_bucketname string +_offsets array + +Detailed Table Information Table(tableName:default__src_src_index_8__, dbName:default, owner:null, createTime:1287802296, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/mwang/Projects/hive/build/ql/test/data/warehouse/default__src_src_index_8__, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1287802296}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) +PREHOOK: query: create index src_index_9 on table src(key) as 'compact' WITH DEFERRED REBUILD TBLPROPERTIES ("prop1"="val1", "prop2"="val2") +PREHOOK: type: CREATEINDEX +POSTHOOK: query: create index src_index_9 on table src(key) as 'compact' WITH DEFERRED REBUILD TBLPROPERTIES ("prop1"="val1", "prop2"="val2") +POSTHOOK: type: CREATEINDEX +PREHOOK: query: desc extended default__src_src_index_9__ +PREHOOK: type: DESCTABLE +POSTHOOK: query: desc extended default__src_src_index_9__ +POSTHOOK: type: DESCTABLE +key string default +_bucketname string +_offsets array + +Detailed Table Information Table(tableName:default__src_src_index_9__, dbName:default, owner:null, createTime:1287802296, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:_bucketname, type:string, comment:), FieldSchema(name:_offsets, type:array, comment:)], location:pfile:/home/mwang/Projects/hive/build/ql/test/data/warehouse/default__src_src_index_9__, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[Order(col:key, order:1)], parameters:{}), partitionKeys:[], parameters:{prop2=val2, prop1=val1, transient_lastDdlTime=1287802296}, viewOriginalText:null, viewExpandedText:null, tableType:INDEX_TABLE) PREHOOK: query: drop index src_index_2 on src PREHOOK: type: DROPINDEX POSTHOOK: query: drop index src_index_2 on src @@ -124,6 +158,14 @@ PREHOOK: query: drop index src_index_7 on src PREHOOK: type: DROPINDEX POSTHOOK: query: drop index src_index_7 on src POSTHOOK: type: DROPINDEX +PREHOOK: query: drop index src_index_8 on src +PREHOOK: type: DROPINDEX +POSTHOOK: query: drop index src_index_8 on src +POSTHOOK: type: DROPINDEX +PREHOOK: query: drop index src_index_9 on src +PREHOOK: type: DROPINDEX +POSTHOOK: query: drop index src_index_9 on src +POSTHOOK: type: DROPINDEX PREHOOK: query: show tables PREHOOK: type: SHOWTABLES POSTHOOK: query: show tables