PREHOOK: query: DROP VIEW view1 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view1 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view2 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view2 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view3 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view3 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view4 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view4 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view5 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view5 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view6 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view6 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view7 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view7 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view8 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view8 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view9 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view9 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view10 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view10 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view11 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view11 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view12 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view12 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view13 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view13 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view14 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view14 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view15 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view15 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP VIEW view16 PREHOOK: type: DROPVIEW POSTHOOK: query: DROP VIEW view16 POSTHOOK: type: DROPVIEW PREHOOK: query: DROP TEMPORARY FUNCTION test_translate PREHOOK: type: DROPFUNCTION POSTHOOK: query: DROP TEMPORARY FUNCTION test_translate POSTHOOK: type: DROPFUNCTION PREHOOK: query: DROP TEMPORARY FUNCTION test_max PREHOOK: type: DROPFUNCTION POSTHOOK: query: DROP TEMPORARY FUNCTION test_max POSTHOOK: type: DROPFUNCTION PREHOOK: query: DROP TEMPORARY FUNCTION test_explode PREHOOK: type: DROPFUNCTION POSTHOOK: query: DROP TEMPORARY FUNCTION test_explode POSTHOOK: type: DROPFUNCTION PREHOOK: query: SELECT * FROM src WHERE key=86 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-53_163_9118502688914640379/-mr-10000 POSTHOOK: query: SELECT * FROM src WHERE key=86 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-53_163_9118502688914640379/-mr-10000 86 val_86 PREHOOK: query: CREATE VIEW view1 AS SELECT value FROM src WHERE key=86 PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-59_673_825963440729865007/-mr-10000 POSTHOOK: query: CREATE VIEW view1 AS SELECT value FROM src WHERE key=86 POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view1 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-59_673_825963440729865007/-mr-10000 PREHOOK: query: CREATE VIEW view2 AS SELECT * FROM src PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-59_789_1214862629838900179/-mr-10000 POSTHOOK: query: CREATE VIEW view2 AS SELECT * FROM src POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view2 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-59_789_1214862629838900179/-mr-10000 PREHOOK: query: CREATE VIEW view3(valoo) TBLPROPERTIES ("fear" = "factor") AS SELECT upper(value) FROM src WHERE key=86 PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-59_822_5445702162710173356/-mr-10000 POSTHOOK: query: CREATE VIEW view3(valoo) TBLPROPERTIES ("fear" = "factor") AS SELECT upper(value) FROM src WHERE key=86 POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view3 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-59_822_5445702162710173356/-mr-10000 PREHOOK: query: SELECT * from view1 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-59_893_7903001695316196439/-mr-10000 POSTHOOK: query: SELECT * from view1 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-37-59_893_7903001695316196439/-mr-10000 val_86 PREHOOK: query: SELECT * from view2 where key=18 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-04_269_4465196677720339126/-mr-10000 POSTHOOK: query: SELECT * from view2 where key=18 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-04_269_4465196677720339126/-mr-10000 18 val_18 18 val_18 PREHOOK: query: SELECT * from view3 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-08_361_4147812294937800580/-mr-10000 POSTHOOK: query: SELECT * from view3 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-08_361_4147812294937800580/-mr-10000 VAL_86 PREHOOK: query: -- test EXPLAIN output for CREATE VIEW EXPLAIN CREATE VIEW view0(valoo) AS SELECT upper(value) FROM src WHERE key=86 PREHOOK: type: CREATEVIEW POSTHOOK: query: -- test EXPLAIN output for CREATE VIEW EXPLAIN CREATE VIEW view0(valoo) AS SELECT upper(value) FROM src WHERE key=86 POSTHOOK: type: CREATEVIEW ABSTRACT SYNTAX TREE: (TOK_CREATEVIEW (TOK_TABNAME view0) (TOK_TABCOLNAME (TOK_TABCOL valoo TOK_NULL)) (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION upper (TOK_TABLE_OR_COL value)))) (TOK_WHERE (= (TOK_TABLE_OR_COL key) 86))))) STAGE DEPENDENCIES: Stage-0 is a root stage STAGE PLANS: Stage: Stage-0 Create View Operator: Create View if not exists: false or replace: false columns: valoo string expanded text: SELECT `_c0` AS `valoo` FROM (SELECT upper(`src`.`value`) FROM `src` WHERE `src`.`key`=86) `view0` name: view0 original text: SELECT upper(value) FROM src WHERE key=86 PREHOOK: query: -- make sure EXPLAIN works with a query which references a view EXPLAIN SELECT * from view2 where key=18 PREHOOK: type: QUERY POSTHOOK: query: -- make sure EXPLAIN works with a query which references a view EXPLAIN SELECT * from view2 where key=18 POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME view2))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (= (TOK_TABLE_OR_COL key) 18)))) STAGE DEPENDENCIES: Stage-1 is a root stage Stage-0 is a root stage STAGE PLANS: Stage: Stage-1 Map Reduce Alias -> Map Operator Tree: view2:src TableScan alias: src Filter Operator predicate: expr: (key = 18) type: boolean Select Operator expressions: expr: key type: string expr: value type: string outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: string expr: _col1 type: string outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat Stage: Stage-0 Fetch Operator limit: -1 PREHOOK: query: SHOW TABLES 'view.*' PREHOOK: type: SHOWTABLES POSTHOOK: query: SHOW TABLES 'view.*' POSTHOOK: type: SHOWTABLES view1 view2 view3 PREHOOK: query: DESCRIBE view1 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE view1 POSTHOOK: type: DESCTABLE value string PREHOOK: query: DESCRIBE EXTENDED view1 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view1 POSTHOOK: type: DESCTABLE value string Detailed Table Information Table(tableName:view1, dbName:default, owner:charleschen, createTime:1310603879, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:value, type:string, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603879}, viewOriginalText:SELECT value FROM src WHERE key=86, viewExpandedText:SELECT `src`.`value` FROM `src` WHERE `src`.`key`=86, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view1 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view1 POSTHOOK: type: DESCTABLE # col_name data_type comment value string None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:37:59 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310603879 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT value FROM src WHERE key=86 View Expanded Text: SELECT `src`.`value` FROM `src` WHERE `src`.`key`=86 PREHOOK: query: DESCRIBE view2 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE view2 POSTHOOK: type: DESCTABLE key string value string PREHOOK: query: DESCRIBE EXTENDED view2 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view2 POSTHOOK: type: DESCTABLE key string value string Detailed Table Information Table(tableName:view2, dbName:default, owner:charleschen, createTime:1310603879, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value, type:string, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603879}, viewOriginalText:SELECT * FROM src, viewExpandedText:SELECT `src`.`key`, `src`.`value` FROM `src`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view2 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view2 POSTHOOK: type: DESCTABLE # col_name data_type comment key string None value string None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:37:59 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310603879 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT * FROM src View Expanded Text: SELECT `src`.`key`, `src`.`value` FROM `src` PREHOOK: query: DESCRIBE view3 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE view3 POSTHOOK: type: DESCTABLE valoo string PREHOOK: query: DESCRIBE EXTENDED view3 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view3 POSTHOOK: type: DESCTABLE valoo string Detailed Table Information Table(tableName:view3, dbName:default, owner:charleschen, createTime:1310603879, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:valoo, type:string, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603879, fear=factor}, viewOriginalText:SELECT upper(value) FROM src WHERE key=86, viewExpandedText:SELECT `_c0` AS `valoo` FROM (SELECT upper(`src`.`value`) FROM `src` WHERE `src`.`key`=86) `view3`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view3 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view3 POSTHOOK: type: DESCTABLE # col_name data_type comment valoo string None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:37:59 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: fear factor transient_lastDdlTime 1310603879 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT upper(value) FROM src WHERE key=86 View Expanded Text: SELECT `_c0` AS `valoo` FROM (SELECT upper(`src`.`value`) FROM `src` WHERE `src`.`key`=86) `view3` PREHOOK: query: ALTER VIEW view3 SET TBLPROPERTIES ("biggest" = "loser") PREHOOK: type: ALTERVIEW_PROPERTIES PREHOOK: Input: default@view3 PREHOOK: Output: default@view3 POSTHOOK: query: ALTER VIEW view3 SET TBLPROPERTIES ("biggest" = "loser") POSTHOOK: type: ALTERVIEW_PROPERTIES POSTHOOK: Input: default@view3 POSTHOOK: Output: default@view3 PREHOOK: query: DESCRIBE EXTENDED view3 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view3 POSTHOOK: type: DESCTABLE valoo string Detailed Table Information Table(tableName:view3, dbName:default, owner:charleschen, createTime:1310603879, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:valoo, type:string, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{last_modified_by=charleschen, last_modified_time=1310603894, biggest=loser, transient_lastDdlTime=1310603894, fear=factor}, viewOriginalText:SELECT upper(value) FROM src WHERE key=86, viewExpandedText:SELECT `_c0` AS `valoo` FROM (SELECT upper(`src`.`value`) FROM `src` WHERE `src`.`key`=86) `view3`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view3 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view3 POSTHOOK: type: DESCTABLE # col_name data_type comment valoo string None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:37:59 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: biggest loser fear factor last_modified_by charleschen last_modified_time 1310603894 transient_lastDdlTime 1310603894 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT upper(value) FROM src WHERE key=86 View Expanded Text: SELECT `_c0` AS `valoo` FROM (SELECT upper(`src`.`value`) FROM `src` WHERE `src`.`key`=86) `view3` PREHOOK: query: CREATE TABLE table1 (key int) PREHOOK: type: CREATETABLE POSTHOOK: query: CREATE TABLE table1 (key int) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@table1 PREHOOK: query: -- use DESCRIBE EXTENDED on a base table and an external table as points -- of comparison for view descriptions DESCRIBE EXTENDED table1 PREHOOK: type: DESCTABLE POSTHOOK: query: -- use DESCRIBE EXTENDED on a base table and an external table as points -- of comparison for view descriptions DESCRIBE EXTENDED table1 POSTHOOK: type: DESCTABLE key int Detailed Table Information Table(tableName:table1, dbName:default, owner:charleschen, createTime:1310603894, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:int, comment:null)], location:pfile:/Users/charleschen/hive-trunk8/build/ql/test/data/warehouse/table1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603894}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: DESCRIBE EXTENDED src1 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED src1 POSTHOOK: type: DESCTABLE key string default value string default Detailed Table Information Table(tableName:src1, dbName:default, owner:null, createTime:1310603870, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:default), FieldSchema(name:value, type:string, comment:default)], location:pfile:/Users/charleschen/hive-trunk8/build/ql/test/data/warehouse/src1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603871}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: -- use DESCRIBE EXTENDED on a base table as a point of comparison for -- view descriptions DESCRIBE EXTENDED table1 PREHOOK: type: DESCTABLE POSTHOOK: query: -- use DESCRIBE EXTENDED on a base table as a point of comparison for -- view descriptions DESCRIBE EXTENDED table1 POSTHOOK: type: DESCTABLE key int Detailed Table Information Table(tableName:table1, dbName:default, owner:charleschen, createTime:1310603894, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:int, comment:null)], location:pfile:/Users/charleschen/hive-trunk8/build/ql/test/data/warehouse/table1, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=1}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603894}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE) PREHOOK: query: INSERT OVERWRITE TABLE table1 SELECT key FROM src WHERE key = 86 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@table1 POSTHOOK: query: INSERT OVERWRITE TABLE table1 SELECT key FROM src WHERE key = 86 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: default@table1 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: SELECT * FROM table1 PREHOOK: type: QUERY PREHOOK: Input: default@table1 PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-20_856_8017512900395561207/-mr-10000 POSTHOOK: query: SELECT * FROM table1 POSTHOOK: type: QUERY POSTHOOK: Input: default@table1 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-20_856_8017512900395561207/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 86 PREHOOK: query: CREATE VIEW view4 AS SELECT * FROM table1 PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-20_994_2103915537838132923/-mr-10000 POSTHOOK: query: CREATE VIEW view4 AS SELECT * FROM table1 POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view4 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-20_994_2103915537838132923/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: SELECT * FROM view4 PREHOOK: type: QUERY PREHOOK: Input: default@table1 PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-21_036_5878124221507821199/-mr-10000 POSTHOOK: query: SELECT * FROM view4 POSTHOOK: type: QUERY POSTHOOK: Input: default@table1 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-21_036_5878124221507821199/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 86 PREHOOK: query: DESCRIBE view4 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE view4 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] key int PREHOOK: query: ALTER TABLE table1 ADD COLUMNS (value STRING) PREHOOK: type: ALTERTABLE_ADDCOLS PREHOOK: Input: default@table1 PREHOOK: Output: default@table1 POSTHOOK: query: ALTER TABLE table1 ADD COLUMNS (value STRING) POSTHOOK: type: ALTERTABLE_ADDCOLS POSTHOOK: Input: default@table1 POSTHOOK: Output: default@table1 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: SELECT * FROM table1 PREHOOK: type: QUERY PREHOOK: Input: default@table1 PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-25_268_2712171874962108130/-mr-10000 POSTHOOK: query: SELECT * FROM table1 POSTHOOK: type: QUERY POSTHOOK: Input: default@table1 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-25_268_2712171874962108130/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 86 NULL PREHOOK: query: SELECT * FROM view4 PREHOOK: type: QUERY PREHOOK: Input: default@table1 PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-25_400_5708905800655505044/-mr-10000 POSTHOOK: query: SELECT * FROM view4 POSTHOOK: type: QUERY POSTHOOK: Input: default@table1 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-25_400_5708905800655505044/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 86 PREHOOK: query: DESCRIBE table1 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE table1 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] key int value string PREHOOK: query: DESCRIBE view4 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE view4 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] key int PREHOOK: query: CREATE VIEW view5 AS SELECT v1.key as key1, v2.key as key2 FROM view4 v1 join view4 v2 PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-29_714_356818972445321356/-mr-10000 POSTHOOK: query: CREATE VIEW view5 AS SELECT v1.key as key1, v2.key as key2 FROM view4 v1 join view4 v2 POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view5 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-29_714_356818972445321356/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: SELECT * FROM view5 PREHOOK: type: QUERY PREHOOK: Input: default@table1 PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-29_805_4846047745940809558/-mr-10000 POSTHOOK: query: SELECT * FROM view5 POSTHOOK: type: QUERY POSTHOOK: Input: default@table1 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-29_805_4846047745940809558/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 86 86 PREHOOK: query: DESCRIBE view5 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE view5 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] key1 int key2 int PREHOOK: query: -- verify that column name and comment in DDL portion -- overrides column alias in SELECT CREATE VIEW view6(valoo COMMENT 'I cannot spell') AS SELECT upper(value) as blarg FROM src WHERE key=86 PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-35_342_3376205654442609940/-mr-10000 POSTHOOK: query: -- verify that column name and comment in DDL portion -- overrides column alias in SELECT CREATE VIEW view6(valoo COMMENT 'I cannot spell') AS SELECT upper(value) as blarg FROM src WHERE key=86 POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view6 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-35_342_3376205654442609940/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE view6 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE view6 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] valoo string I cannot spell PREHOOK: query: -- verify that ORDER BY and LIMIT are both supported in view def CREATE VIEW view7 AS SELECT * FROM src WHERE key > 80 AND key < 100 ORDER BY key, value LIMIT 10 PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-35_451_3448617193978586019/-mr-10000 POSTHOOK: query: -- verify that ORDER BY and LIMIT are both supported in view def CREATE VIEW view7 AS SELECT * FROM src WHERE key > 80 AND key < 100 ORDER BY key, value LIMIT 10 POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view7 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-35_451_3448617193978586019/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: SELECT * FROM view7 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-35_504_3801856019496800857/-mr-10000 POSTHOOK: query: SELECT * FROM view7 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-35_504_3801856019496800857/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 82 val_82 83 val_83 83 val_83 84 val_84 84 val_84 85 val_85 86 val_86 87 val_87 90 val_90 90 val_90 PREHOOK: query: -- top-level ORDER BY should override the one inside the view -- (however, the inside ORDER BY should still influence the evaluation -- of the limit) SELECT * FROM view7 ORDER BY key DESC, value PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-40_971_1377390003555435006/-mr-10000 POSTHOOK: query: -- top-level ORDER BY should override the one inside the view -- (however, the inside ORDER BY should still influence the evaluation -- of the limit) SELECT * FROM view7 ORDER BY key DESC, value POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-40_971_1377390003555435006/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 90 val_90 90 val_90 87 val_87 86 val_86 85 val_85 84 val_84 84 val_84 83 val_83 83 val_83 82 val_82 PREHOOK: query: -- top-level LIMIT should override if lower SELECT * FROM view7 LIMIT 5 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-50_436_2621140053808181556/-mr-10000 POSTHOOK: query: -- top-level LIMIT should override if lower SELECT * FROM view7 LIMIT 5 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-50_436_2621140053808181556/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 82 val_82 83 val_83 83 val_83 84 val_84 84 val_84 PREHOOK: query: -- but not if higher SELECT * FROM view7 LIMIT 20 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-55_759_5789780673698162776/-mr-10000 POSTHOOK: query: -- but not if higher SELECT * FROM view7 LIMIT 20 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-38-55_759_5789780673698162776/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 82 val_82 83 val_83 83 val_83 84 val_84 84 val_84 85 val_85 86 val_86 87 val_87 90 val_90 90 val_90 PREHOOK: query: -- test usage of a function within a view CREATE TEMPORARY FUNCTION test_translate AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFTestTranslate' PREHOOK: type: CREATEFUNCTION POSTHOOK: query: -- test usage of a function within a view CREATE TEMPORARY FUNCTION test_translate AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFTestTranslate' POSTHOOK: type: CREATEFUNCTION POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: CREATE VIEW view8(c) AS SELECT test_translate('abc', 'a', 'b') FROM table1 PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-01_201_785568782558368274/-mr-10000 POSTHOOK: query: CREATE VIEW view8(c) AS SELECT test_translate('abc', 'a', 'b') FROM table1 POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view8 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-01_201_785568782558368274/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE EXTENDED view8 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view8 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] c string Detailed Table Information Table(tableName:view8, dbName:default, owner:charleschen, createTime:1310603941, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:c, type:string, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603941}, viewOriginalText:SELECT test_translate('abc', 'a', 'b') FROM table1, viewExpandedText:SELECT `_c0` AS `c` FROM (SELECT `test_translate`('abc', 'a', 'b') FROM `table1`) `view8`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view8 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view8 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] # col_name data_type comment c string None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:39:01 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310603941 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT test_translate('abc', 'a', 'b') FROM table1 View Expanded Text: SELECT `_c0` AS `c` FROM (SELECT `test_translate`('abc', 'a', 'b') FROM `table1`) `view8` PREHOOK: query: SELECT * FROM view8 PREHOOK: type: QUERY PREHOOK: Input: default@table1 PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-01_381_7020367472651711034/-mr-10000 POSTHOOK: query: SELECT * FROM view8 POSTHOOK: type: QUERY POSTHOOK: Input: default@table1 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-01_381_7020367472651711034/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] bbc PREHOOK: query: -- test usage of a UDAF within a view CREATE TEMPORARY FUNCTION test_max AS 'org.apache.hadoop.hive.ql.udf.UDAFTestMax' PREHOOK: type: CREATEFUNCTION POSTHOOK: query: -- test usage of a UDAF within a view CREATE TEMPORARY FUNCTION test_max AS 'org.apache.hadoop.hive.ql.udf.UDAFTestMax' POSTHOOK: type: CREATEFUNCTION POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: CREATE VIEW view9(m) AS SELECT test_max(length(value)) FROM src PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-05_545_7629389724413361063/-mr-10000 POSTHOOK: query: CREATE VIEW view9(m) AS SELECT test_max(length(value)) FROM src POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view9 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-05_545_7629389724413361063/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE EXTENDED view9 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view9 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] m int Detailed Table Information Table(tableName:view9, dbName:default, owner:charleschen, createTime:1310603945, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:m, type:int, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603945}, viewOriginalText:SELECT test_max(length(value)) FROM src, viewExpandedText:SELECT `_c0` AS `m` FROM (SELECT `test_max`(length(`src`.`value`)) FROM `src`) `view9`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view9 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view9 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] # col_name data_type comment m int None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:39:05 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310603945 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT test_max(length(value)) FROM src View Expanded Text: SELECT `_c0` AS `m` FROM (SELECT `test_max`(length(`src`.`value`)) FROM `src`) `view9` PREHOOK: query: SELECT * FROM view9 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-05_736_2247977153276084609/-mr-10000 POSTHOOK: query: SELECT * FROM view9 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-05_736_2247977153276084609/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 7 PREHOOK: query: -- test usage of a subselect within a view CREATE VIEW view10 AS SELECT slurp.* FROM (SELECT * FROM src WHERE key=86) slurp PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-11_371_6717441826933002839/-mr-10000 POSTHOOK: query: -- test usage of a subselect within a view CREATE VIEW view10 AS SELECT slurp.* FROM (SELECT * FROM src WHERE key=86) slurp POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view10 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-11_371_6717441826933002839/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE EXTENDED view10 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view10 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] key string value string Detailed Table Information Table(tableName:view10, dbName:default, owner:charleschen, createTime:1310603951, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value, type:string, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603951}, viewOriginalText:SELECT slurp.* FROM (SELECT * FROM src WHERE key=86) slurp, viewExpandedText:SELECT `slurp`.`key`, `slurp`.`value` FROM (SELECT `src`.`key`, `src`.`value` FROM `src` WHERE `src`.`key`=86) `slurp`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view10 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view10 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] # col_name data_type comment key string None value string None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:39:11 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310603951 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT slurp.* FROM (SELECT * FROM src WHERE key=86) slurp View Expanded Text: SELECT `slurp`.`key`, `slurp`.`value` FROM (SELECT `src`.`key`, `src`.`value` FROM `src` WHERE `src`.`key`=86) `slurp` PREHOOK: query: SELECT * FROM view10 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-11_543_6060996569477225470/-mr-10000 POSTHOOK: query: SELECT * FROM view10 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-11_543_6060996569477225470/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 86 val_86 PREHOOK: query: -- test usage of a UDTF within a view CREATE TEMPORARY FUNCTION test_explode AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDTFExplode' PREHOOK: type: CREATEFUNCTION POSTHOOK: query: -- test usage of a UDTF within a view CREATE TEMPORARY FUNCTION test_explode AS 'org.apache.hadoop.hive.ql.udf.generic.GenericUDTFExplode' POSTHOOK: type: CREATEFUNCTION POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: CREATE VIEW view11 AS SELECT test_explode(array(1,2,3)) AS (boom) FROM table1 PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-16_070_211791124585720413/-mr-10000 POSTHOOK: query: CREATE VIEW view11 AS SELECT test_explode(array(1,2,3)) AS (boom) FROM table1 POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view11 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-16_070_211791124585720413/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE EXTENDED view11 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view11 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] boom int Detailed Table Information Table(tableName:view11, dbName:default, owner:charleschen, createTime:1310603956, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:boom, type:int, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603956}, viewOriginalText:SELECT test_explode(array(1,2,3)) AS (boom) FROM table1, viewExpandedText:SELECT `test_explode`(array(1,2,3)) AS (`boom`) FROM `table1`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view11 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view11 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] # col_name data_type comment boom int None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:39:16 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310603956 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT test_explode(array(1,2,3)) AS (boom) FROM table1 View Expanded Text: SELECT `test_explode`(array(1,2,3)) AS (`boom`) FROM `table1` PREHOOK: query: SELECT * FROM view11 PREHOOK: type: QUERY PREHOOK: Input: default@table1 PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-16_251_6002551073862339351/-mr-10000 POSTHOOK: query: SELECT * FROM view11 POSTHOOK: type: QUERY POSTHOOK: Input: default@table1 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-16_251_6002551073862339351/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 1 2 3 PREHOOK: query: -- test usage of LATERAL within a view CREATE VIEW view12 AS SELECT * FROM src LATERAL VIEW explode(array(1,2,3)) myTable AS myCol PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-20_410_2134918459409553976/-mr-10000 POSTHOOK: query: -- test usage of LATERAL within a view CREATE VIEW view12 AS SELECT * FROM src LATERAL VIEW explode(array(1,2,3)) myTable AS myCol POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view12 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-20_410_2134918459409553976/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE EXTENDED view12 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view12 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] key string value string mycol int Detailed Table Information Table(tableName:view12, dbName:default, owner:charleschen, createTime:1310603960, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value, type:string, comment:null), FieldSchema(name:mycol, type:int, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603960}, viewOriginalText:SELECT * FROM src LATERAL VIEW explode(array(1,2,3)) myTable AS myCol, viewExpandedText:SELECT `src`.`key`, `src`.`value`, `mytable`.`mycol` FROM `src` LATERAL VIEW explode(array(1,2,3)) `myTable` AS `myCol`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view12 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view12 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] # col_name data_type comment key string None value string None mycol int None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:39:20 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310603960 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT * FROM src LATERAL VIEW explode(array(1,2,3)) myTable AS myCol View Expanded Text: SELECT `src`.`key`, `src`.`value`, `mytable`.`mycol` FROM `src` LATERAL VIEW explode(array(1,2,3)) `myTable` AS `myCol` PREHOOK: query: SELECT * FROM view12 ORDER BY key ASC, myCol ASC LIMIT 1 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-20_580_4844122789933214545/-mr-10000 POSTHOOK: query: SELECT * FROM view12 ORDER BY key ASC, myCol ASC LIMIT 1 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-20_580_4844122789933214545/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 0 val_0 1 PREHOOK: query: -- test usage of LATERAL with a view as the LHS SELECT * FROM view2 LATERAL VIEW explode(array(1,2,3)) myTable AS myCol ORDER BY key ASC, myCol ASC LIMIT 1 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-26_246_5139279882550794599/-mr-10000 POSTHOOK: query: -- test usage of LATERAL with a view as the LHS SELECT * FROM view2 LATERAL VIEW explode(array(1,2,3)) myTable AS myCol ORDER BY key ASC, myCol ASC LIMIT 1 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-26_246_5139279882550794599/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 0 val_0 1 PREHOOK: query: -- test usage of TABLESAMPLE within a view CREATE VIEW view13 AS SELECT s.key FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 5 ON key) s PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-31_831_3525059676816615664/-mr-10000 POSTHOOK: query: -- test usage of TABLESAMPLE within a view CREATE VIEW view13 AS SELECT s.key FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 5 ON key) s POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view13 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-31_831_3525059676816615664/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE EXTENDED view13 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view13 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] key int Detailed Table Information Table(tableName:view13, dbName:default, owner:charleschen, createTime:1310603971, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:int, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603971}, viewOriginalText:SELECT s.key FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 5 ON key) s, viewExpandedText:SELECT `s`.`key` FROM `srcbucket` TABLESAMPLE (BUCKET 1 OUT OF 5 ON `key`) `s`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view13 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view13 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] # col_name data_type comment key int None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:39:31 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310603971 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT s.key FROM srcbucket TABLESAMPLE (BUCKET 1 OUT OF 5 ON key) s View Expanded Text: SELECT `s`.`key` FROM `srcbucket` TABLESAMPLE (BUCKET 1 OUT OF 5 ON `key`) `s` PREHOOK: query: SELECT * FROM view13 ORDER BY key LIMIT 12 PREHOOK: type: QUERY PREHOOK: Input: default@srcbucket PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-32_035_6011908196363303140/-mr-10000 POSTHOOK: query: SELECT * FROM view13 ORDER BY key LIMIT 12 POSTHOOK: type: QUERY POSTHOOK: Input: default@srcbucket POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-32_035_6011908196363303140/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 0 0 0 0 0 5 5 5 5 10 10 15 PREHOOK: query: -- test usage of JOIN+UNION+AGG all within same view CREATE VIEW view14 AS SELECT unionsrc1.key as k1, unionsrc1.value as v1, unionsrc2.key as k2, unionsrc2.value as v2 FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1 UNION ALL select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1 JOIN (select 'tst1' as key, cast(count(1) as string) as value from src s3 UNION ALL select s4.key as key, s4.value as value from src s4 where s4.key < 10) unionsrc2 ON (unionsrc1.key = unionsrc2.key) PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-37_420_5315665176801493302/-mr-10000 POSTHOOK: query: -- test usage of JOIN+UNION+AGG all within same view CREATE VIEW view14 AS SELECT unionsrc1.key as k1, unionsrc1.value as v1, unionsrc2.key as k2, unionsrc2.value as v2 FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1 UNION ALL select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1 JOIN (select 'tst1' as key, cast(count(1) as string) as value from src s3 UNION ALL select s4.key as key, s4.value as value from src s4 where s4.key < 10) unionsrc2 ON (unionsrc1.key = unionsrc2.key) POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view14 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-37_420_5315665176801493302/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE EXTENDED view14 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view14 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] k1 string v1 string k2 string v2 string Detailed Table Information Table(tableName:view14, dbName:default, owner:charleschen, createTime:1310603977, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:k1, type:string, comment:null), FieldSchema(name:v1, type:string, comment:null), FieldSchema(name:k2, type:string, comment:null), FieldSchema(name:v2, type:string, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310603977}, viewOriginalText:SELECT unionsrc1.key as k1, unionsrc1.value as v1, unionsrc2.key as k2, unionsrc2.value as v2 FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1 UNION ALL select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1 JOIN (select 'tst1' as key, cast(count(1) as string) as value from src s3 UNION ALL select s4.key as key, s4.value as value from src s4 where s4.key < 10) unionsrc2 ON (unionsrc1.key = unionsrc2.key), viewExpandedText:SELECT `unionsrc1`.`key` as `k1`, `unionsrc1`.`value` as `v1`, `unionsrc2`.`key` as `k2`, `unionsrc2`.`value` as `v2` FROM (select 'tst1' as `key`, cast(count(1) as string) as `value` from `src` `s1` UNION ALL select `s2`.`key` as `key`, `s2`.`value` as `value` from `src` `s2` where `s2`.`key` < 10) `unionsrc1` JOIN (select 'tst1' as `key`, cast(count(1) as string) as `value` from `src` `s3` UNION ALL select `s4`.`key` as `key`, `s4`.`value` as `value` from `src` `s4` where `s4`.`key` < 10) `unionsrc2` ON (`unionsrc1`.`key` = `unionsrc2`.`key`), tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view14 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view14 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] # col_name data_type comment k1 string None v1 string None k2 string None v2 string None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:39:37 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310603977 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT unionsrc1.key as k1, unionsrc1.value as v1, unionsrc2.key as k2, unionsrc2.value as v2 FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1 UNION ALL select s2.key as key, s2.value as value from src s2 where s2.key < 10) unionsrc1 JOIN (select 'tst1' as key, cast(count(1) as string) as value from src s3 UNION ALL select s4.key as key, s4.value as value from src s4 where s4.key < 10) unionsrc2 ON (unionsrc1.key = unionsrc2.key) View Expanded Text: SELECT `unionsrc1`.`key` as `k1`, `unionsrc1`.`value` as `v1`, `unionsrc2`.`key` as `k2`, `unionsrc2`.`value` as `v2` FROM (select 'tst1' as `key`, cast(count(1) as string) as `value` from `src` `s1` UNION ALL select `s2`.`key` as `key`, `s2`.`value` as `value` from `src` `s2` where `s2`.`key` < 10) `unionsrc1` JOIN (select 'tst1' as `key`, cast(count(1) as string) as `value` from `src` `s3` UNION ALL select `s4`.`key` as `key`, `s4`.`value` as `value` from `src` `s4` where `s4`.`key` < 10) `unionsrc2` ON (`unionsrc1`.`key` = `unionsrc2`.`key`) PREHOOK: query: SELECT * FROM view14 ORDER BY k1 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-37_652_4983836798943047790/-mr-10000 POSTHOOK: query: SELECT * FROM view14 ORDER BY k1 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-39-37_652_4983836798943047790/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 0 val_0 2 val_2 2 val_2 4 val_4 4 val_4 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 5 val_5 8 val_8 8 val_8 9 val_9 9 val_9 tst1 500 tst1 500 PREHOOK: query: -- test usage of GROUP BY within view CREATE VIEW view15 AS SELECT key,COUNT(value) AS value_count FROM src GROUP BY key PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-40-10_678_1836712795976358294/-mr-10000 POSTHOOK: query: -- test usage of GROUP BY within view CREATE VIEW view15 AS SELECT key,COUNT(value) AS value_count FROM src GROUP BY key POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view15 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-40-10_678_1836712795976358294/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE EXTENDED view15 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view15 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] key string value_count bigint Detailed Table Information Table(tableName:view15, dbName:default, owner:charleschen, createTime:1310604010, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:key, type:string, comment:null), FieldSchema(name:value_count, type:bigint, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310604010}, viewOriginalText:SELECT key,COUNT(value) AS value_count FROM src GROUP BY key, viewExpandedText:SELECT `src`.`key`,COUNT(`src`.`value`) AS `value_count` FROM `src` GROUP BY `src`.`key`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view15 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view15 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] # col_name data_type comment key string None value_count bigint None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:40:10 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310604010 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT key,COUNT(value) AS value_count FROM src GROUP BY key View Expanded Text: SELECT `src`.`key`,COUNT(`src`.`value`) AS `value_count` FROM `src` GROUP BY `src`.`key` PREHOOK: query: SELECT * FROM view15 ORDER BY value_count DESC, key LIMIT 10 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-40-10_848_3595216836858483372/-mr-10000 POSTHOOK: query: SELECT * FROM view15 ORDER BY value_count DESC, key LIMIT 10 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-40-10_848_3595216836858483372/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 230 5 348 5 401 5 469 5 138 4 169 4 277 4 406 4 468 4 489 4 PREHOOK: query: -- test usage of DISTINCT within view CREATE VIEW view16 AS SELECT DISTINCT value FROM src PREHOOK: type: CREATEVIEW PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-40-19_814_3865857892584276594/-mr-10000 POSTHOOK: query: -- test usage of DISTINCT within view CREATE VIEW view16 AS SELECT DISTINCT value FROM src POSTHOOK: type: CREATEVIEW POSTHOOK: Output: default@view16 POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-40-19_814_3865857892584276594/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE EXTENDED view16 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE EXTENDED view16 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] value string Detailed Table Information Table(tableName:view16, dbName:default, owner:charleschen, createTime:1310604019, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:value, type:string, comment:null)], location:null, inputFormat:org.apache.hadoop.mapred.SequenceFileInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:null, parameters:{}), bucketCols:[], sortCols:[], parameters:{}), partitionKeys:[], parameters:{transient_lastDdlTime=1310604019}, viewOriginalText:SELECT DISTINCT value FROM src, viewExpandedText:SELECT DISTINCT `src`.`value` FROM `src`, tableType:VIRTUAL_VIEW) PREHOOK: query: DESCRIBE FORMATTED view16 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE FORMATTED view16 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] # col_name data_type comment value string None # Detailed Table Information Database: default Owner: charleschen CreateTime: Wed Jul 13 17:40:19 PDT 2011 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Table Type: VIRTUAL_VIEW Table Parameters: transient_lastDdlTime 1310604019 # Storage Information SerDe Library: null InputFormat: org.apache.hadoop.mapred.SequenceFileInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] # View Information View Original Text: SELECT DISTINCT value FROM src View Expanded Text: SELECT DISTINCT `src`.`value` FROM `src` PREHOOK: query: SELECT * FROM view16 ORDER BY value LIMIT 10 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-40-19_984_1843143508360196786/-mr-10000 POSTHOOK: query: SELECT * FROM view16 ORDER BY value LIMIT 10 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: file:/var/folders/fe/fefl-ow3ElaEd1ns0G7jB0uewEQ/-Tmp-/charleschen/hive_2011-07-13_17-40-19_984_1843143508360196786/-mr-10000 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] val_0 val_10 val_100 val_103 val_104 val_105 val_11 val_111 val_113 val_114 PREHOOK: query: -- HIVE-2133: DROP TABLE IF EXISTS should ignore a matching view name DROP TABLE IF EXISTS view16 PREHOOK: type: DROPTABLE PREHOOK: Input: default@view16 PREHOOK: Output: default@view16 POSTHOOK: query: -- HIVE-2133: DROP TABLE IF EXISTS should ignore a matching view name DROP TABLE IF EXISTS view16 POSTHOOK: type: DROPTABLE POSTHOOK: Input: default@view16 POSTHOOK: Output: default@view16 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE view16 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE view16 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] value string PREHOOK: query: -- Likewise, DROP VIEW IF EXISTS should ignore a matching table name DROP VIEW IF EXISTS table1 PREHOOK: type: DROPVIEW PREHOOK: Input: default@table1 PREHOOK: Output: default@table1 POSTHOOK: query: -- Likewise, DROP VIEW IF EXISTS should ignore a matching table name DROP VIEW IF EXISTS table1 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@table1 POSTHOOK: Output: default@table1 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DESCRIBE table1 PREHOOK: type: DESCTABLE POSTHOOK: query: DESCRIBE table1 POSTHOOK: type: DESCTABLE POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] key int value string PREHOOK: query: -- this should work since currently we don't track view->table -- dependencies for implementing RESTRICT DROP VIEW view1 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view1 PREHOOK: Output: default@view1 POSTHOOK: query: -- this should work since currently we don't track view->table -- dependencies for implementing RESTRICT DROP VIEW view1 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view1 POSTHOOK: Output: default@view1 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view2 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view2 PREHOOK: Output: default@view2 POSTHOOK: query: DROP VIEW view2 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view2 POSTHOOK: Output: default@view2 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view3 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view3 PREHOOK: Output: default@view3 POSTHOOK: query: DROP VIEW view3 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view3 POSTHOOK: Output: default@view3 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view4 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view4 PREHOOK: Output: default@view4 POSTHOOK: query: DROP VIEW view4 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view4 POSTHOOK: Output: default@view4 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view5 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view5 PREHOOK: Output: default@view5 POSTHOOK: query: DROP VIEW view5 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view5 POSTHOOK: Output: default@view5 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view6 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view6 PREHOOK: Output: default@view6 POSTHOOK: query: DROP VIEW view6 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view6 POSTHOOK: Output: default@view6 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view7 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view7 PREHOOK: Output: default@view7 POSTHOOK: query: DROP VIEW view7 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view7 POSTHOOK: Output: default@view7 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view8 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view8 PREHOOK: Output: default@view8 POSTHOOK: query: DROP VIEW view8 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view8 POSTHOOK: Output: default@view8 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view9 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view9 PREHOOK: Output: default@view9 POSTHOOK: query: DROP VIEW view9 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view9 POSTHOOK: Output: default@view9 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view10 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view10 PREHOOK: Output: default@view10 POSTHOOK: query: DROP VIEW view10 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view10 POSTHOOK: Output: default@view10 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view11 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view11 PREHOOK: Output: default@view11 POSTHOOK: query: DROP VIEW view11 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view11 POSTHOOK: Output: default@view11 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view12 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view12 PREHOOK: Output: default@view12 POSTHOOK: query: DROP VIEW view12 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view12 POSTHOOK: Output: default@view12 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view13 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view13 PREHOOK: Output: default@view13 POSTHOOK: query: DROP VIEW view13 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view13 POSTHOOK: Output: default@view13 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view14 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view14 PREHOOK: Output: default@view14 POSTHOOK: query: DROP VIEW view14 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view14 POSTHOOK: Output: default@view14 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view15 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view15 PREHOOK: Output: default@view15 POSTHOOK: query: DROP VIEW view15 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view15 POSTHOOK: Output: default@view15 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP VIEW view16 PREHOOK: type: DROPVIEW PREHOOK: Input: default@view16 PREHOOK: Output: default@view16 POSTHOOK: query: DROP VIEW view16 POSTHOOK: type: DROPVIEW POSTHOOK: Input: default@view16 POSTHOOK: Output: default@view16 POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP TEMPORARY FUNCTION test_translate PREHOOK: type: DROPFUNCTION POSTHOOK: query: DROP TEMPORARY FUNCTION test_translate POSTHOOK: type: DROPFUNCTION POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP TEMPORARY FUNCTION test_max PREHOOK: type: DROPFUNCTION POSTHOOK: query: DROP TEMPORARY FUNCTION test_max POSTHOOK: type: DROPFUNCTION POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: DROP TEMPORARY FUNCTION test_explode PREHOOK: type: DROPFUNCTION POSTHOOK: query: DROP TEMPORARY FUNCTION test_explode POSTHOOK: type: DROPFUNCTION POSTHOOK: Lineage: table1.key EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ]