Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
set hive.fetch.task.conversion=none;
set hive.explain.user=false;

create external table tbl_ice_pp_key(a int, b string)
partitioned by spec (a) stored by iceberg;

insert into tbl_ice_pp_key values (1, 'one'), (2, 'two');
alter table tbl_ice_pp_key create tag s1;

insert into tbl_ice_pp_key values
(3, 'three'), (4, 'four'), (5, 'five'),
(6, 'six'), (7, 'seven'),(8, 'eight'),
(9, 'nine'), (10, 'ten');

explain select count(*) from tbl_ice_pp_key;
select count(*) from tbl_ice_pp_key;

explain select count(*) from tbl_ice_pp_key for system_version as of 's1';
select count(*) from tbl_ice_pp_key for system_version as of 's1';

explain
select cur.cnt as cur_cnt, snap.cnt as snap_cnt
from (
select count(*) as cnt from tbl_ice_pp_key
) cur
cross join (
select count(*) as cnt from tbl_ice_pp_key for system_version as of 's1'
) snap;

select cur.cnt as cur_cnt, snap.cnt as snap_cnt
from (
select count(*) as cnt from tbl_ice_pp_key
) cur
cross join (
select count(*) as cnt from tbl_ice_pp_key for system_version as of 's1'
) snap;

-- with a partition predicate
Comment thread
deniskuzZ marked this conversation as resolved.
explain
select 'current' as ver, count(*) as cnt from tbl_ice_pp_key where a > 2
union all
select 'asof_s1' as ver, count(*) as cnt from tbl_ice_pp_key for system_version as of 's1'
where a > 2;

select 'current' as ver, count(*) as cnt from tbl_ice_pp_key where a > 2
union all
select 'asof_s1' as ver, count(*) as cnt from tbl_ice_pp_key for system_version as of 's1'
where a > 2;

drop table tbl_ice_pp_key;
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice_t
POSTHOOK: Output: hdfs://### HDFS PATH ###
OPTIMIZED SQL: SELECT `committed_at` AS `ice_t.snapshots.committed_at`, `snapshot_id` AS `ice_t.snapshots.snapshot_id`, `parent_id` AS `ice_t.snapshots.parent_id`, `operation` AS `ice_t.snapshots.operation`, `manifest_list` AS `ice_t.snapshots.manifest_list`, `summary` AS `ice_t.snapshots.summary`
FROM `default`.`ice_t`
FROM `default`.`ice_t`.`snapshots`
STAGE DEPENDENCIES:
Stage-0 is a root stage

Expand Down
Loading
Loading