Files
impala/testdata/workloads/functional-planner/queries/PlannerTest/insert.test
2014-01-08 10:46:33 -08:00

205 lines
5.7 KiB
Plaintext

# insert into an unpartitioned table
insert into table alltypesnopart
select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
float_col, double_col, date_string_col, string_col, timestamp_col
from alltypes
where year=2009 and month=05
---- PLAN
Plan Fragment 0
UNPARTITIONED
WRITE TO HDFS table=default.alltypesnopart
OVERWRITE=false
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- DISTRIBUTEDPLAN
Plan Fragment 0
RANDOM
WRITE TO HDFS table=default.alltypesnopart
OVERWRITE=false
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- SCANRANGELOCATIONS
NODE 0:
HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=5/090501.txt 0:20853
LOCATIONS:
====
# insert into a static partition
insert into table alltypessmall
partition (year=2009, month=04)
select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
float_col, double_col, date_string_col, string_col, timestamp_col
from alltypes
where year=2009 and month=05
---- PLAN
Plan Fragment 0
UNPARTITIONED
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=false
PARTITIONS: 2009,4
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- DISTRIBUTEDPLAN
Plan Fragment 0
RANDOM
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=false
PARTITIONS: 2009,4
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- SCANRANGELOCATIONS
NODE 0:
HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=5/090501.txt 0:20853
LOCATIONS:
====
# overwrite a static partition
insert overwrite table alltypessmall
partition (year=2009, month=04)
select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
float_col, double_col, date_string_col, string_col, timestamp_col
from alltypes
where year=2009 and month=05
---- PLAN
Plan Fragment 0
UNPARTITIONED
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=true
PARTITIONS: 2009,4
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- DISTRIBUTEDPLAN
Plan Fragment 0
RANDOM
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=true
PARTITIONS: 2009,4
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- SCANRANGELOCATIONS
NODE 0:
HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=5/090501.txt 0:20853
LOCATIONS:
====
# insert into a fully dynamic partition
insert into table alltypessmall
partition (year, month)
select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
float_col, double_col, date_string_col, string_col, timestamp_col, year, month
from alltypes
where year=2009 and month>10
---- PLAN
Plan Fragment 0
UNPARTITIONED
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=false
PARTITIONS: year,month
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- DISTRIBUTEDPLAN
Plan Fragment 0
RANDOM
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=false
PARTITIONS: year,month
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- SCANRANGELOCATIONS
NODE 0:
HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=11/091101.txt 0:20179
LOCATIONS:
HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=12/091201.txt 0:20853
LOCATIONS:
====
# insert into a partially dynamic partition
insert into table alltypessmall
partition (year=2009, month)
select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
float_col, double_col, date_string_col, string_col, timestamp_col, month
from alltypes
where year=2009 and month>10
---- PLAN
Plan Fragment 0
UNPARTITIONED
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=false
PARTITIONS: 2009,month
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- DISTRIBUTEDPLAN
Plan Fragment 0
RANDOM
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=false
PARTITIONS: 2009,month
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- SCANRANGELOCATIONS
NODE 0:
HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=11/091101.txt 0:20179
LOCATIONS:
HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=12/091201.txt 0:20853
LOCATIONS:
====
# insert into a partially dynamic partition
insert into table alltypessmall
partition (year, month=4)
select id, bool_col, tinyint_col, smallint_col, int_col, bigint_col,
float_col, double_col, date_string_col, string_col, timestamp_col, year
from alltypes
where year>2009 and month=4
---- PLAN
Plan Fragment 0
UNPARTITIONED
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=false
PARTITIONS: year,4
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- DISTRIBUTEDPLAN
Plan Fragment 0
RANDOM
WRITE TO HDFS table=default.alltypessmall
OVERWRITE=false
PARTITIONS: year,4
SCAN HDFS table=default.alltypes (0)
TUPLE IDS: 0
---- SCANRANGELOCATIONS
NODE 0:
HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2010/month=4/100401.txt 0:20179
LOCATIONS:
====
# insert with limit from partitioned table.
insert into table alltypesnopart
select *
from alltypes where year=2009 and month=1 limit 10
---- PLAN
Plan Fragment 0
UNPARTITIONED
WRITE TO HDFS table=default.alltypesnopart
OVERWRITE=false
SCAN HDFS table=default.alltypes (0)
LIMIT: 10
TUPLE IDS: 0
---- DISTRIBUTEDPLAN
Plan Fragment 0
UNPARTITIONED
WRITE TO HDFS table=default.alltypesnopart
OVERWRITE=false
EXCHANGE (1)
LIMIT: 10
TUPLE IDS: 0
Plan Fragment 1
RANDOM
STREAM DATA SINK
EXCHANGE ID: 1
UNPARTITIONED
SCAN HDFS table=default.alltypes (0)
LIMIT: 10
TUPLE IDS: 0
---- SCANRANGELOCATIONS
NODE 0:
HDFS SPLIT hdfs://localhost:20500/test-warehouse/alltypes/year=2009/month=1/090101.txt 0:20433
LOCATIONS:
====