blob: 494f399f7c55d47275a464333fa1079a32830c4d [file] [log] [blame]
# Regression test for IMPALA-12510: select star on empty table
select * from functional.emptytable;
---- QUERYOPTIONS
MAX_FRAGMENT_INSTANCES_PER_NODE=16
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=4.00MB Threads=2
Per-Host Resource Estimates: Memory=10MB
F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
| max-parallelism=1 segment-costs=[0]
PLAN-ROOT SINK
| output exprs: functional.emptytable.field, functional.emptytable.f2
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0 cost=0
|
01:EXCHANGE [UNPARTITIONED]
| mem-estimate=20.00KB mem-reservation=0B thread-reservation=0
| tuple-ids=0 row-size=16B cardinality=0 cost=0
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
Per-Instance Resources: mem-estimate=80.00KB mem-reservation=0B thread-reservation=1
max-parallelism=1 segment-costs=[0]
00:SCAN HDFS [functional.emptytable, RANDOM]
partitions=0/0 files=0 size=0B
stored statistics:
table: rows=unavailable size=unavailable
partitions: 0/0 rows=0
columns missing stats: field
extrapolated-rows=disabled max-scan-range-rows=0
mem-estimate=0B mem-reservation=0B thread-reservation=0
tuple-ids=0 row-size=16B cardinality=0 cost=0
in pipelines: 00(GETNEXT)
====
# IMPALA-12192: Test that scan fragment parallelism can scale beyond the scan node cost.
# In this query, preagg node colocated in the scan fragment will have higher cost than
# the scan node, and increase the parallelism of the scan fragment.
select
ss_net_paid_inc_tax,
ss_ext_list_price,
ss_net_profit,
ss_net_paid,
ss_ext_sales_price,
sum(ss_store_sk)
from store_sales
group by rollup (
ss_net_paid_inc_tax,
ss_ext_list_price,
ss_net_profit,
ss_net_paid,
ss_ext_sales_price)
limit 100
---- QUERYOPTIONS
MAX_FRAGMENT_INSTANCES_PER_NODE=16
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=1.81GB Threads=11
Per-Host Resource Estimates: Memory=2.38GB
F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.03MB mem-reservation=4.00MB thread-reservation=1
| max-parallelism=1 segment-costs=[625] cpu-comparison-result=21 [max(1 (self) vs 21 (sum children))]
PLAN-ROOT SINK
| output exprs: CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN ss_net_paid_inc_tax WHEN 2 THEN ss_net_paid_inc_tax WHEN 3 THEN ss_net_paid_inc_tax WHEN 4 THEN ss_net_paid_inc_tax WHEN 5 THEN ss_net_paid_inc_tax WHEN 6 THEN NULL END, CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN ss_ext_list_price WHEN 2 THEN ss_ext_list_price WHEN 3 THEN ss_ext_list_price WHEN 4 THEN ss_ext_list_price WHEN 5 THEN NULL WHEN 6 THEN NULL END, CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN ss_net_profit WHEN 2 THEN ss_net_profit WHEN 3 THEN ss_net_profit WHEN 4 THEN NULL WHEN 5 THEN NULL WHEN 6 THEN NULL END, CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN ss_net_paid WHEN 2 THEN ss_net_paid WHEN 3 THEN NULL WHEN 4 THEN NULL WHEN 5 THEN NULL WHEN 6 THEN NULL END, CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN ss_ext_sales_price WHEN 2 THEN NULL WHEN 3 THEN NULL WHEN 4 THEN NULL WHEN 5 THEN NULL WHEN 6 THEN NULL END, aggif(valid_tid(1,2,3,4,5,6) IN (1, 2, 3, 4, 5, 6), CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN sum(ss_store_sk) WHEN 2 THEN sum(ss_store_sk) WHEN 3 THEN sum(ss_store_sk) WHEN 4 THEN sum(ss_store_sk) WHEN 5 THEN sum(ss_store_sk) WHEN 6 THEN sum(ss_store_sk) END)
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0 cost=600
|
05:EXCHANGE [UNPARTITIONED]
| limit: 100
| mem-estimate=32.68KB mem-reservation=0B thread-reservation=0
| tuple-ids=7 row-size=32B cardinality=100 cost=25
| in pipelines: 02(GETNEXT)
|
F01:PLAN FRAGMENT [HASH(CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 2 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 3 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 4 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 5 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_ext_list_price) WHEN 2 THEN murmur_hash(ss_ext_list_price) WHEN 3 THEN murmur_hash(ss_ext_list_price) WHEN 4 THEN murmur_hash(ss_ext_list_price) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_net_profit) WHEN 2 THEN murmur_hash(ss_net_profit) WHEN 3 THEN murmur_hash(ss_net_profit) WHEN 4 THEN murmur_hash(NULL) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_net_paid) WHEN 2 THEN murmur_hash(ss_net_paid) WHEN 3 THEN murmur_hash(NULL) WHEN 4 THEN murmur_hash(NULL) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_ext_sales_price) WHEN 2 THEN murmur_hash(NULL) WHEN 3 THEN murmur_hash(NULL) WHEN 4 THEN murmur_hash(NULL) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END)] hosts=3 instances=9 (adjusted from 48)
Per-Instance Resources: mem-estimate=338.71MB mem-reservation=205.94MB thread-reservation=1
max-parallelism=9 segment-costs=[89809878, 71651035, 257] cpu-comparison-result=21 [max(9 (self) vs 21 (sum children))]
02:AGGREGATE [FINALIZE]
| output: aggif(valid_tid(1,2,3,4,5,6) IN (CAST(1 AS INT), CAST(2 AS INT), CAST(3 AS INT), CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT)), CASE valid_tid(1,2,3,4,5,6) WHEN CAST(1 AS INT) THEN sum(ss_store_sk) WHEN CAST(2 AS INT) THEN sum(ss_store_sk) WHEN CAST(3 AS INT) THEN sum(ss_store_sk) WHEN CAST(4 AS INT) THEN sum(ss_store_sk) WHEN CAST(5 AS INT) THEN sum(ss_store_sk) WHEN CAST(6 AS INT) THEN sum(ss_store_sk) END)
| group by: CASE valid_tid(1,2,3,4,5,6) WHEN CAST(1 AS INT) THEN ss_net_paid_inc_tax WHEN CAST(2 AS INT) THEN ss_net_paid_inc_tax WHEN CAST(3 AS INT) THEN ss_net_paid_inc_tax WHEN CAST(4 AS INT) THEN ss_net_paid_inc_tax WHEN CAST(5 AS INT) THEN ss_net_paid_inc_tax WHEN CAST(6 AS INT) THEN NULL END, CASE valid_tid(1,2,3,4,5,6) WHEN CAST(1 AS INT) THEN ss_ext_list_price WHEN CAST(2 AS INT) THEN ss_ext_list_price WHEN CAST(3 AS INT) THEN ss_ext_list_price WHEN CAST(4 AS INT) THEN ss_ext_list_price WHEN CAST(5 AS INT) THEN NULL WHEN CAST(6 AS INT) THEN NULL END, CASE valid_tid(1,2,3,4,5,6) WHEN CAST(1 AS INT) THEN ss_net_profit WHEN CAST(2 AS INT) THEN ss_net_profit WHEN CAST(3 AS INT) THEN ss_net_profit WHEN CAST(4 AS INT) THEN NULL WHEN CAST(5 AS INT) THEN NULL WHEN CAST(6 AS INT) THEN NULL END, CASE valid_tid(1,2,3,4,5,6) WHEN CAST(1 AS INT) THEN ss_net_paid WHEN CAST(2 AS INT) THEN ss_net_paid WHEN CAST(3 AS INT) THEN NULL WHEN CAST(4 AS INT) THEN NULL WHEN CAST(5 AS INT) THEN NULL WHEN CAST(6 AS INT) THEN NULL END, CASE valid_tid(1,2,3,4,5,6) WHEN CAST(1 AS INT) THEN ss_ext_sales_price WHEN CAST(2 AS INT) THEN NULL WHEN CAST(3 AS INT) THEN NULL WHEN CAST(4 AS INT) THEN NULL WHEN CAST(5 AS INT) THEN NULL WHEN CAST(6 AS INT) THEN NULL END, CASE valid_tid(1,2,3,4,5,6) WHEN CAST(1 AS INT) THEN CAST(1 AS INT) WHEN CAST(2 AS INT) THEN CAST(2 AS INT) WHEN CAST(3 AS INT) THEN CAST(3 AS INT) WHEN CAST(4 AS INT) THEN CAST(4 AS INT) WHEN CAST(5 AS INT) THEN CAST(5 AS INT) WHEN CAST(6 AS INT) THEN CAST(6 AS INT) END
| limit: 100
| mem-estimate=56.60MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=7 row-size=32B cardinality=100 cost=71651035
| in pipelines: 02(GETNEXT), 04(OPEN)
|
04:AGGREGATE [FINALIZE]
| Class 0
| output: sum:merge(ss_store_sk)
| group by: ss_net_paid_inc_tax, ss_ext_list_price, ss_net_profit, ss_net_paid, ss_ext_sales_price
| Class 1
| output: sum:merge(ss_store_sk)
| group by: ss_net_paid_inc_tax, ss_ext_list_price, ss_net_profit, ss_net_paid, NULL
| Class 2
| output: sum:merge(ss_store_sk)
| group by: ss_net_paid_inc_tax, ss_ext_list_price, ss_net_profit, NULL, NULL
| Class 3
| output: sum:merge(ss_store_sk)
| group by: ss_net_paid_inc_tax, ss_ext_list_price, NULL, NULL, NULL
| Class 4
| output: sum:merge(ss_store_sk)
| group by: ss_net_paid_inc_tax, NULL, NULL, NULL, NULL
| Class 5
| output: sum:merge(ss_store_sk)
| group by: NULL, NULL, NULL, NULL, NULL
| mem-estimate=282.11MB mem-reservation=171.94MB thread-reservation=0
| tuple-ids=1N,2N,3N,4N,5N,6N row-size=168B cardinality=12.14M cost=74574636
| in pipelines: 04(GETNEXT), 00(OPEN)
|
03:EXCHANGE [HASH(CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 2 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 3 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 4 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 5 THEN murmur_hash(ss_net_paid_inc_tax) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_ext_list_price) WHEN 2 THEN murmur_hash(ss_ext_list_price) WHEN 3 THEN murmur_hash(ss_ext_list_price) WHEN 4 THEN murmur_hash(ss_ext_list_price) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_net_profit) WHEN 2 THEN murmur_hash(ss_net_profit) WHEN 3 THEN murmur_hash(ss_net_profit) WHEN 4 THEN murmur_hash(NULL) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_net_paid) WHEN 2 THEN murmur_hash(ss_net_paid) WHEN 3 THEN murmur_hash(NULL) WHEN 4 THEN murmur_hash(NULL) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(1,2,3,4,5,6) WHEN 1 THEN murmur_hash(ss_ext_sales_price) WHEN 2 THEN murmur_hash(NULL) WHEN 3 THEN murmur_hash(NULL) WHEN 4 THEN murmur_hash(NULL) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END)]
| mem-estimate=13.94MB mem-reservation=0B thread-reservation=0
| tuple-ids=1N,2N,3N,4N,5N,6N row-size=168B cardinality=14.27M cost=15235242
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=21 (adjusted from 48)
Per-Instance Resources: mem-estimate=202.75MB mem-reservation=176.00MB thread-reservation=1
max-parallelism=21 segment-costs=[89349287, 198453333]
01:AGGREGATE [STREAMING]
| Class 0
| output: sum(CAST(ss_store_sk AS BIGINT))
| group by: ss_net_paid_inc_tax, ss_ext_list_price, ss_net_profit, ss_net_paid, ss_ext_sales_price
| Class 1
| output: sum(CAST(ss_store_sk AS BIGINT))
| group by: ss_net_paid_inc_tax, ss_ext_list_price, ss_net_profit, ss_net_paid, NULL
| Class 2
| output: sum(CAST(ss_store_sk AS BIGINT))
| group by: ss_net_paid_inc_tax, ss_ext_list_price, ss_net_profit, NULL, NULL
| Class 3
| output: sum(CAST(ss_store_sk AS BIGINT))
| group by: ss_net_paid_inc_tax, ss_ext_list_price, NULL, NULL, NULL
| Class 4
| output: sum(CAST(ss_store_sk AS BIGINT))
| group by: ss_net_paid_inc_tax, NULL, NULL, NULL, NULL
| Class 5
| output: sum(CAST(ss_store_sk AS BIGINT))
| group by: NULL, NULL, NULL, NULL, NULL
| mem-estimate=180.00MB mem-reservation=172.00MB thread-reservation=0
| tuple-ids=1N,2N,3N,4N,5N,6N row-size=168B cardinality=14.27M cost=88353820
| in pipelines: 00(GETNEXT)
|
00:SCAN HDFS [tpcds_partitioned_parquet_snap.store_sales, RANDOM]
HDFS partitions=1824/1824 files=1824 size=200.96MB
stored statistics:
table: rows=2.88M size=200.96MB
partitions: 1824/1824 rows=2.88M
columns: all
extrapolated-rows=disabled max-scan-range-rows=130.09K
mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
tuple-ids=0 row-size=24B cardinality=2.88M cost=995467
in pipelines: 00(GETNEXT)
====
select * from income_band;
---- QUERYOPTIONS
MAX_FRAGMENT_INSTANCES_PER_NODE=16
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=4.02MB Threads=2
Per-Host Resource Estimates: Memory=20MB
F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
| max-parallelism=1 segment-costs=[63]
PLAN-ROOT SINK
| output exprs: tpcds_partitioned_parquet_snap.income_band.ib_income_band_sk, tpcds_partitioned_parquet_snap.income_band.ib_lower_bound, tpcds_partitioned_parquet_snap.income_band.ib_upper_bound
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0 cost=60
|
01:EXCHANGE [UNPARTITIONED]
| mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
| tuple-ids=0 row-size=12B cardinality=20 cost=3
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
Per-Instance Resources: mem-estimate=16.06MB mem-reservation=24.00KB thread-reservation=1
max-parallelism=1 segment-costs=[28]
00:SCAN HDFS [tpcds_partitioned_parquet_snap.income_band, RANDOM]
HDFS partitions=1/1 files=1 size=1.22KB
stored statistics:
table: rows=20 size=1.22KB
columns: all
extrapolated-rows=disabled max-scan-range-rows=20
mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
tuple-ids=0 row-size=12B cardinality=20 cost=3
in pipelines: 00(GETNEXT)
====
# Scan cost should be exactly the same as select star without limit.
select * from income_band limit 1000000000;
---- QUERYOPTIONS
MAX_FRAGMENT_INSTANCES_PER_NODE=16
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=4.02MB Threads=2
Per-Host Resource Estimates: Memory=20MB
F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
| max-parallelism=1 segment-costs=[63]
PLAN-ROOT SINK
| output exprs: tpcds_partitioned_parquet_snap.income_band.ib_income_band_sk, tpcds_partitioned_parquet_snap.income_band.ib_lower_bound, tpcds_partitioned_parquet_snap.income_band.ib_upper_bound
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0 cost=60
|
01:EXCHANGE [UNPARTITIONED]
| limit: 1000000000
| mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
| tuple-ids=0 row-size=12B cardinality=20 cost=3
| in pipelines: 00(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
Per-Instance Resources: mem-estimate=16.06MB mem-reservation=24.00KB thread-reservation=1
max-parallelism=1 segment-costs=[28]
00:SCAN HDFS [tpcds_partitioned_parquet_snap.income_band, RANDOM]
HDFS partitions=1/1 files=1 size=1.22KB
stored statistics:
table: rows=20 size=1.22KB
columns: all
extrapolated-rows=disabled max-scan-range-rows=20
limit: 1000000000
mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
tuple-ids=0 row-size=12B cardinality=20 cost=3
in pipelines: 00(GETNEXT)
====
# IMPALA-13152: Regression test for TOP-N query over empty table.
select field, rk from (
select
field, f2,
row_number()
over (partition by field order by f2) rk
from functional.emptytable
) b
where rk = 1;
---- QUERYOPTIONS
MAX_FRAGMENT_INSTANCES_PER_NODE=16
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=48.00MB Threads=4
Per-Host Resource Estimates: Memory=48MB
F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.06MB mem-reservation=4.00MB thread-reservation=1
| max-parallelism=1 segment-costs=[0] cpu-comparison-result=2 [max(1 (self) vs 2 (sum children))]
PLAN-ROOT SINK
| output exprs: field, row_number()
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0 cost=0
|
06:EXCHANGE [UNPARTITIONED]
| mem-estimate=64.00KB mem-reservation=0B thread-reservation=0
| tuple-ids=4,3 row-size=24B cardinality=0 cost=0
| in pipelines: 05(GETNEXT)
|
F01:PLAN FRAGMENT [HASH(field)] hosts=1 instances=2 (adjusted from 1)
Per-Instance Resources: mem-estimate=16.12MB mem-reservation=16.00MB thread-reservation=1
max-parallelism=1 segment-costs=[0, 0] cpu-comparison-result=2 [max(2 (self) vs 1 (sum children))]
03:SELECT
| predicates: row_number() = CAST(1 AS BIGINT)
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=4,3 row-size=24B cardinality=0 cost=0
| in pipelines: 05(GETNEXT)
|
02:ANALYTIC
| functions: row_number()
| partition by: field
| order by: f2 ASC
| window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4,3 row-size=24B cardinality=0 cost=0
| in pipelines: 05(GETNEXT)
|
05:TOP-N
| partition by: field
| order by: f2 ASC
| partition limit: 1
| mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=16B cardinality=0 cost=0
| in pipelines: 05(GETNEXT), 01(OPEN)
|
04:EXCHANGE [HASH(field)]
| mem-estimate=20.00KB mem-reservation=0B thread-reservation=0
| tuple-ids=4 row-size=16B cardinality=0 cost=0
| in pipelines: 01(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
Per-Instance Resources: mem-estimate=12.16MB mem-reservation=12.00MB thread-reservation=1
max-parallelism=1 segment-costs=[0, 0]
01:TOP-N
| partition by: field
| order by: f2 ASC
| partition limit: 1
| source expr: row_number() = CAST(1 AS BIGINT)
| mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=4 row-size=16B cardinality=0 cost=0
| in pipelines: 01(GETNEXT), 00(OPEN)
|
00:SCAN HDFS [functional.emptytable, RANDOM]
partitions=0/0 files=0 size=0B
stored statistics:
table: rows=unavailable size=unavailable
partitions: 0/0 rows=0
columns missing stats: field
extrapolated-rows=disabled max-scan-range-rows=0
mem-estimate=0B mem-reservation=0B thread-reservation=0
tuple-ids=0 row-size=16B cardinality=0 cost=0
in pipelines: 00(GETNEXT)
====
# IMPALA-14006: Regression test for UNPARTITIONED fragment in probe side.
# F03 should schedule 2 instances because F01 is only 1 node and 1 instance.
select
timestamp_col,
rank
from
functional.alltypessmall alts
left outer join (
select id, dense_rank() over(order by id) as rank, int_col from functional.alltypes
) rank_view on (rank_view.id = alts.id)
where rank < 10;
---- QUERYOPTIONS
MAX_FRAGMENT_INSTANCES_PER_NODE=2
---- PARALLELPLANS
Max Per-Host Resource Reservation: Memory=15.98MB Threads=6
Per-Host Resource Estimates: Memory=49MB
F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
| Per-Instance Resources: mem-estimate=4.02MB mem-reservation=4.00MB thread-reservation=1
| max-parallelism=1 segment-costs=[233] cpu-comparison-result=8 [max(5 (self) vs 8 (sum children))]
PLAN-ROOT SINK
| output exprs: timestamp_col, dense_rank()
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0 cost=200
|
09:EXCHANGE [UNPARTITIONED]
| mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
| tuple-ids=7N,6N,0 row-size=32B cardinality=100 cost=33
| in pipelines: 02(GETNEXT)
|
F03:PLAN FRAGMENT [HASH(alts.id)] hosts=3 instances=2 (adjusted from 6)
Per-Instance Resources: mem-estimate=193.11KB mem-reservation=0B thread-reservation=1
max-parallelism=3 segment-costs=[713]
05:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
| hash-table-id=00
| hash predicates: id = alts.id
| fk/pk conjuncts: id = alts.id
| other predicates: dense_rank() < CAST(10 AS BIGINT)
| mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
| tuple-ids=7N,6N,0 row-size=32B cardinality=100 cost=205
| in pipelines: 02(GETNEXT), 00(OPEN)
|
|--F05:PLAN FRAGMENT [HASH(alts.id)] hosts=3 instances=2 (adjusted from 6)
| | Per-Instance Resources: mem-estimate=1.95MB mem-reservation=1.94MB thread-reservation=1
| | max-parallelism=3 segment-costs=[120]
| JOIN BUILD
| | join-table-id=00 plan-id=01 cohort-id=01
| | build expressions: alts.id
| | mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0 cost=100
| |
| 08:EXCHANGE [HASH(alts.id)]
| | mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
| | tuple-ids=0 row-size=20B cardinality=100 cost=20
| | in pipelines: 00(GETNEXT)
| |
| F02:PLAN FRAGMENT [RANDOM] hosts=3 instances=3 (adjusted from 4)
| Per-Instance Resources: mem-estimate=16.19MB mem-reservation=8.00KB thread-reservation=1
| max-parallelism=3 segment-costs=[409]
| 00:SCAN HDFS [functional.alltypessmall alts, RANDOM]
| HDFS partitions=4/4 files=4 size=6.32KB
| stored statistics:
| table: rows=100 size=6.32KB
| partitions: 4/4 rows=100
| columns: all
| extrapolated-rows=disabled max-scan-range-rows=25
| mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=0
| tuple-ids=0 row-size=20B cardinality=100 cost=229
| in pipelines: 00(GETNEXT)
|
07:EXCHANGE [HASH(id)]
| mem-estimate=17.11KB mem-reservation=0B thread-reservation=0
| tuple-ids=7,6 row-size=12B cardinality=730 cost=148
| in pipelines: 02(GETNEXT)
|
F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
Per-Instance Resources: mem-estimate=4.19MB mem-reservation=4.00MB thread-reservation=1
max-parallelism=1 segment-costs=[17820]
04:SELECT
| predicates: dense_rank() < CAST(10 AS BIGINT)
| mem-estimate=0B mem-reservation=0B thread-reservation=0
| tuple-ids=7,6 row-size=12B cardinality=730 cost=7300
| in pipelines: 02(GETNEXT)
|
03:ANALYTIC
| functions: dense_rank()
| order by: id ASC
| window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
| mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=7,6 row-size=12B cardinality=7.30K cost=7300
| in pipelines: 02(GETNEXT)
|
06:MERGING-EXCHANGE [UNPARTITIONED]
| order by: id ASC
| mem-estimate=33.50KB mem-reservation=0B thread-reservation=0
| tuple-ids=7 row-size=4B cardinality=7.30K cost=1904
| in pipelines: 02(GETNEXT)
|
F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3 (adjusted from 6)
Per-Instance Resources: mem-estimate=22.00MB mem-reservation=6.03MB thread-reservation=1
max-parallelism=3 segment-costs=[20162, 3059]
02:SORT
| order by: id ASC
| mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
| tuple-ids=7 row-size=4B cardinality=7.30K cost=2819
| in pipelines: 02(GETNEXT), 01(OPEN)
|
01:SCAN HDFS [functional.alltypes, RANDOM]
HDFS partitions=24/24 files=24 size=478.45KB
stored statistics:
table: rows=7.30K size=478.45KB
partitions: 24/24 rows=7.30K
columns: all
extrapolated-rows=disabled max-scan-range-rows=310
mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
tuple-ids=1 row-size=4B cardinality=7.30K cost=17343
in pipelines: 01(GETNEXT)
====