PREHOOK: query: -- Test if index is actually being used. -- Create temp, and populate it with some values in src. CREATE TABLE temp(key STRING, val STRING) PARTITIONED BY (foo string) STORED AS TEXTFILE PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@temp POSTHOOK: query: -- Test if index is actually being used. -- Create temp, and populate it with some values in src. CREATE TABLE temp(key STRING, val STRING) PARTITIONED BY (foo string) STORED AS TEXTFILE POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@temp PREHOOK: query: ALTER TABLE temp ADD PARTITION (foo = 'bar') PREHOOK: type: ALTERTABLE_ADDPARTS PREHOOK: Output: default@temp POSTHOOK: query: ALTER TABLE temp ADD PARTITION (foo = 'bar') POSTHOOK: type: ALTERTABLE_ADDPARTS POSTHOOK: Output: default@temp POSTHOOK: Output: default@temp@foo=bar PREHOOK: query: INSERT OVERWRITE TABLE temp PARTITION (foo = 'bar') SELECT * FROM src WHERE key < 50 PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@temp@foo=bar POSTHOOK: query: INSERT OVERWRITE TABLE temp PARTITION (foo = 'bar') SELECT * FROM src WHERE key < 50 POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: default@temp@foo=bar POSTHOOK: Lineage: temp PARTITION(foo=bar).key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: temp PARTITION(foo=bar).val SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] PREHOOK: query: -- Build an index on temp. CREATE INDEX temp_index ON TABLE temp(key) as 'COMPACT' WITH DEFERRED REBUILD PREHOOK: type: CREATEINDEX PREHOOK: Input: default@temp POSTHOOK: query: -- Build an index on temp. CREATE INDEX temp_index ON TABLE temp(key) as 'COMPACT' WITH DEFERRED REBUILD POSTHOOK: type: CREATEINDEX POSTHOOK: Input: default@temp POSTHOOK: Output: default@default__temp_temp_index__ PREHOOK: query: ALTER INDEX temp_index ON temp PARTITION (foo = 'bar') REBUILD PREHOOK: type: ALTERINDEX_REBUILD PREHOOK: Input: default@temp PREHOOK: Input: default@temp@foo=bar PREHOOK: Output: default@default__temp_temp_index__@foo=bar POSTHOOK: query: ALTER INDEX temp_index ON temp PARTITION (foo = 'bar') REBUILD POSTHOOK: type: ALTERINDEX_REBUILD POSTHOOK: Input: default@temp POSTHOOK: Input: default@temp@foo=bar POSTHOOK: Output: default@default__temp_temp_index__@foo=bar POSTHOOK: Lineage: default__temp_temp_index__ PARTITION(foo=bar)._bucketname SIMPLE [(temp)temp.FieldSchema(name:INPUT__FILE__NAME, type:string, comment:), ] POSTHOOK: Lineage: default__temp_temp_index__ PARTITION(foo=bar)._offsets EXPRESSION [(temp)temp.FieldSchema(name:BLOCK__OFFSET__INSIDE__FILE, type:bigint, comment:), ] POSTHOOK: Lineage: default__temp_temp_index__ PARTITION(foo=bar).key SIMPLE [(temp)temp.FieldSchema(name:key, type:string, comment:null), ] PREHOOK: query: -- overwrite temp table so index is out of date INSERT OVERWRITE TABLE temp PARTITION (foo = 'bar') SELECT * FROM src PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@temp@foo=bar POSTHOOK: query: -- overwrite temp table so index is out of date INSERT OVERWRITE TABLE temp PARTITION (foo = 'bar') SELECT * FROM src POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: default@temp@foo=bar POSTHOOK: Lineage: temp PARTITION(foo=bar).key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: temp PARTITION(foo=bar).val SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] PREHOOK: query: -- query should not return any values SELECT * FROM default__temp_temp_index__ WHERE key = 86 AND foo='bar' PREHOOK: type: QUERY PREHOOK: Input: default@default__temp_temp_index__ PREHOOK: Input: default@default__temp_temp_index__@foo=bar #### A masked pattern was here #### POSTHOOK: query: -- query should not return any values SELECT * FROM default__temp_temp_index__ WHERE key = 86 AND foo='bar' POSTHOOK: type: QUERY POSTHOOK: Input: default@default__temp_temp_index__ POSTHOOK: Input: default@default__temp_temp_index__@foo=bar #### A masked pattern was here #### PREHOOK: query: EXPLAIN SELECT * FROM temp WHERE key = 86 AND foo = 'bar' PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN SELECT * FROM temp WHERE key = 86 AND foo = 'bar' POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-0 is a root stage STAGE PLANS: Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: TableScan alias: temp filterExpr: ((UDFToDouble(key) = 86.0) and (foo = 'bar')) (type: boolean) Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Filter Operator predicate: (UDFToDouble(key) = 86.0) (type: boolean) Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: '86' (type: string), val (type: string), 'bar' (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE ListSink PREHOOK: query: SELECT * FROM temp WHERE key = 86 AND foo = 'bar' PREHOOK: type: QUERY PREHOOK: Input: default@temp PREHOOK: Input: default@temp@foo=bar #### A masked pattern was here #### POSTHOOK: query: SELECT * FROM temp WHERE key = 86 AND foo = 'bar' POSTHOOK: type: QUERY POSTHOOK: Input: default@temp POSTHOOK: Input: default@temp@foo=bar #### A masked pattern was here #### 86 val_86 bar PREHOOK: query: DROP table temp PREHOOK: type: DROPTABLE PREHOOK: Input: default@temp PREHOOK: Output: default@temp POSTHOOK: query: DROP table temp POSTHOOK: type: DROPTABLE POSTHOOK: Input: default@temp POSTHOOK: Output: default@temp