PREHOOK: query: -- SORT_QUERY_RESULTS -- Verify that table scans work with partitioned Avro tables CREATE TABLE episodes ( title string COMMENT "episode title", air_date string COMMENT "initial date", doctor int COMMENT "main actor playing the Doctor in episode") STORED AS AVRO PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@episodes POSTHOOK: query: -- SORT_QUERY_RESULTS -- Verify that table scans work with partitioned Avro tables CREATE TABLE episodes ( title string COMMENT "episode title", air_date string COMMENT "initial date", doctor int COMMENT "main actor playing the Doctor in episode") STORED AS AVRO POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@episodes PREHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/episodes.avro' INTO TABLE episodes PREHOOK: type: LOAD #### A masked pattern was here #### PREHOOK: Output: default@episodes POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/episodes.avro' INTO TABLE episodes POSTHOOK: type: LOAD #### A masked pattern was here #### POSTHOOK: Output: default@episodes PREHOOK: query: CREATE TABLE episodes_partitioned ( title string COMMENT "episode title", air_date string COMMENT "initial date", doctor int COMMENT "main actor playing the Doctor in episode") PARTITIONED BY (doctor_pt INT) STORED AS AVRO PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@episodes_partitioned POSTHOOK: query: CREATE TABLE episodes_partitioned ( title string COMMENT "episode title", air_date string COMMENT "initial date", doctor int COMMENT "main actor playing the Doctor in episode") PARTITIONED BY (doctor_pt INT) STORED AS AVRO POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@episodes_partitioned PREHOOK: query: INSERT OVERWRITE TABLE episodes_partitioned PARTITION (doctor_pt) SELECT title, air_date, doctor, doctor as doctor_pt FROM episodes PREHOOK: type: QUERY PREHOOK: Input: default@episodes PREHOOK: Output: default@episodes_partitioned POSTHOOK: query: INSERT OVERWRITE TABLE episodes_partitioned PARTITION (doctor_pt) SELECT title, air_date, doctor, doctor as doctor_pt FROM episodes POSTHOOK: type: QUERY POSTHOOK: Input: default@episodes POSTHOOK: Output: default@episodes_partitioned@doctor_pt=1 POSTHOOK: Output: default@episodes_partitioned@doctor_pt=11 POSTHOOK: Output: default@episodes_partitioned@doctor_pt=2 POSTHOOK: Output: default@episodes_partitioned@doctor_pt=4 POSTHOOK: Output: default@episodes_partitioned@doctor_pt=5 POSTHOOK: Output: default@episodes_partitioned@doctor_pt=6 POSTHOOK: Output: default@episodes_partitioned@doctor_pt=9 POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=11).air_date SIMPLE [(episodes)episodes.FieldSchema(name:air_date, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=11).doctor SIMPLE [(episodes)episodes.FieldSchema(name:doctor, type:int, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=11).title SIMPLE [(episodes)episodes.FieldSchema(name:title, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=1).air_date SIMPLE [(episodes)episodes.FieldSchema(name:air_date, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=1).doctor SIMPLE [(episodes)episodes.FieldSchema(name:doctor, type:int, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=1).title SIMPLE [(episodes)episodes.FieldSchema(name:title, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=2).air_date SIMPLE [(episodes)episodes.FieldSchema(name:air_date, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=2).doctor SIMPLE [(episodes)episodes.FieldSchema(name:doctor, type:int, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=2).title SIMPLE [(episodes)episodes.FieldSchema(name:title, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=4).air_date SIMPLE [(episodes)episodes.FieldSchema(name:air_date, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=4).doctor SIMPLE [(episodes)episodes.FieldSchema(name:doctor, type:int, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=4).title SIMPLE [(episodes)episodes.FieldSchema(name:title, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=5).air_date SIMPLE [(episodes)episodes.FieldSchema(name:air_date, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=5).doctor SIMPLE [(episodes)episodes.FieldSchema(name:doctor, type:int, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=5).title SIMPLE [(episodes)episodes.FieldSchema(name:title, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=6).air_date SIMPLE [(episodes)episodes.FieldSchema(name:air_date, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=6).doctor SIMPLE [(episodes)episodes.FieldSchema(name:doctor, type:int, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=6).title SIMPLE [(episodes)episodes.FieldSchema(name:title, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=9).air_date SIMPLE [(episodes)episodes.FieldSchema(name:air_date, type:string, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=9).doctor SIMPLE [(episodes)episodes.FieldSchema(name:doctor, type:int, comment:from deserializer), ] POSTHOOK: Lineage: episodes_partitioned PARTITION(doctor_pt=9).title SIMPLE [(episodes)episodes.FieldSchema(name:title, type:string, comment:from deserializer), ] PREHOOK: query: ALTER TABLE episodes_partitioned SET SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe' WITH SERDEPROPERTIES ('avro.schema.literal'='{ "namespace": "testing.hive.avro.serde", "name": "episodes", "type": "record", "fields": [ { "name":"title", "type":"string", "doc":"episode title" }, { "name":"air_date", "type":"string", "doc":"initial date" }, { "name":"doctor", "type":"int", "doc":"main actor playing the Doctor in episode" }, { "name":"value", "type":"int", "default":0, "doc":"default value" } ] }') PREHOOK: type: ALTERTABLE_SERIALIZER PREHOOK: Input: default@episodes_partitioned PREHOOK: Output: default@episodes_partitioned POSTHOOK: query: ALTER TABLE episodes_partitioned SET SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe' WITH SERDEPROPERTIES ('avro.schema.literal'='{ "namespace": "testing.hive.avro.serde", "name": "episodes", "type": "record", "fields": [ { "name":"title", "type":"string", "doc":"episode title" }, { "name":"air_date", "type":"string", "doc":"initial date" }, { "name":"doctor", "type":"int", "doc":"main actor playing the Doctor in episode" }, { "name":"value", "type":"int", "default":0, "doc":"default value" } ] }') POSTHOOK: type: ALTERTABLE_SERIALIZER POSTHOOK: Input: default@episodes_partitioned POSTHOOK: Output: default@episodes_partitioned PREHOOK: query: SELECT * FROM episodes_partitioned WHERE doctor_pt > 6 PREHOOK: type: QUERY PREHOOK: Input: default@episodes_partitioned PREHOOK: Input: default@episodes_partitioned@doctor_pt=11 PREHOOK: Input: default@episodes_partitioned@doctor_pt=9 #### A masked pattern was here #### POSTHOOK: query: SELECT * FROM episodes_partitioned WHERE doctor_pt > 6 POSTHOOK: type: QUERY POSTHOOK: Input: default@episodes_partitioned POSTHOOK: Input: default@episodes_partitioned@doctor_pt=11 POSTHOOK: Input: default@episodes_partitioned@doctor_pt=9 #### A masked pattern was here #### Rose 26 March 2005 9 0 9 The Doctor's Wife 14 May 2011 11 0 11 The Eleventh Hour 3 April 2010 11 0 11 PREHOOK: query: -- Verify that Fetch works in addition to Map SELECT * FROM episodes_partitioned ORDER BY air_date LIMIT 5 PREHOOK: type: QUERY PREHOOK: Input: default@episodes_partitioned PREHOOK: Input: default@episodes_partitioned@doctor_pt=1 PREHOOK: Input: default@episodes_partitioned@doctor_pt=11 PREHOOK: Input: default@episodes_partitioned@doctor_pt=2 PREHOOK: Input: default@episodes_partitioned@doctor_pt=4 PREHOOK: Input: default@episodes_partitioned@doctor_pt=5 PREHOOK: Input: default@episodes_partitioned@doctor_pt=6 PREHOOK: Input: default@episodes_partitioned@doctor_pt=9 #### A masked pattern was here #### POSTHOOK: query: -- Verify that Fetch works in addition to Map SELECT * FROM episodes_partitioned ORDER BY air_date LIMIT 5 POSTHOOK: type: QUERY POSTHOOK: Input: default@episodes_partitioned POSTHOOK: Input: default@episodes_partitioned@doctor_pt=1 POSTHOOK: Input: default@episodes_partitioned@doctor_pt=11 POSTHOOK: Input: default@episodes_partitioned@doctor_pt=2 POSTHOOK: Input: default@episodes_partitioned@doctor_pt=4 POSTHOOK: Input: default@episodes_partitioned@doctor_pt=5 POSTHOOK: Input: default@episodes_partitioned@doctor_pt=6 POSTHOOK: Input: default@episodes_partitioned@doctor_pt=9 #### A masked pattern was here #### An Unearthly Child 23 November 1963 1 0 1 Horror of Fang Rock 3 September 1977 4 0 4 Rose 26 March 2005 9 0 9 The Doctor's Wife 14 May 2011 11 0 11 The Eleventh Hour 3 April 2010 11 0 11 PREHOOK: query: -- Fetch w/filter to specific partition SELECT * FROM episodes_partitioned WHERE doctor_pt = 6 PREHOOK: type: QUERY PREHOOK: Input: default@episodes_partitioned PREHOOK: Input: default@episodes_partitioned@doctor_pt=6 #### A masked pattern was here #### POSTHOOK: query: -- Fetch w/filter to specific partition SELECT * FROM episodes_partitioned WHERE doctor_pt = 6 POSTHOOK: type: QUERY POSTHOOK: Input: default@episodes_partitioned POSTHOOK: Input: default@episodes_partitioned@doctor_pt=6 #### A masked pattern was here #### The Mysterious Planet 6 September 1986 6 0 6 PREHOOK: query: -- Fetch w/non-existent partition SELECT * FROM episodes_partitioned WHERE doctor_pt = 7 LIMIT 5 PREHOOK: type: QUERY PREHOOK: Input: default@episodes_partitioned #### A masked pattern was here #### POSTHOOK: query: -- Fetch w/non-existent partition SELECT * FROM episodes_partitioned WHERE doctor_pt = 7 LIMIT 5 POSTHOOK: type: QUERY POSTHOOK: Input: default@episodes_partitioned #### A masked pattern was here ####