1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
# name: test/sql/logging/physical_operator_logging.test_slow
# description: Test physical operator logging
# group: [logging]
require parquet
statement ok
CALL enable_logging('PhysicalOperator')
# force external so we can see the external log message being added
statement ok
set debug_force_external=true
statement ok
set threads=1
# trigger external join, order result by i so we have good and predictable zone maps
statement ok
copy (
select t1.i
from range(3_000_000) t1(i)
join range(3_000_000) t2(i)
using (i)
order by i
) to '__TEST_DIR__/physical_operator_logging.parquet'
# this is for row group read/skip logging
statement ok
from '__TEST_DIR__/physical_operator_logging.parquet' where i = 42
statement ok
CALL disable_logging()
# enabling external hash join happens exactly once
query I
select count(*) from duckdb_logs_parsed('PhysicalOperator') where class = 'PhysicalHashJoin' and event = 'Finalize' and info.external
----
1
# 4 radix bits, external hash join, should build exactly 16 times
query I
select count(*) from duckdb_logs_parsed('PhysicalOperator') where class = 'JoinHashTable' and event = 'Build'
----
16
query I
select info.total_probe_matches from duckdb_logs_parsed('PhysicalOperator') where class = 'PhysicalHashJoin' and event = 'GetData'
----
3000000
# all flushed row groups should be logged, these should be equal
query I
select count(*) = (
select count(distinct row_group_id)
from parquet_metadata('__TEST_DIR__/physical_operator_logging.parquet')
)
from duckdb_logs_parsed('PhysicalOperator') where class = 'ParquetWriter' and event = 'FlushRowGroup'
----
1
# there are many row groups, but only one of them contains the value 42, so we should only have 1 of these
query I
select count(*) from duckdb_logs_parsed('PhysicalOperator') where class = 'ParquetReader' and event = 'ReadRowGroup'
----
1
# all other row groups are skipped
query I
select count(*) from duckdb_logs_parsed('PhysicalOperator') where class = 'ParquetReader' and event = 'SkipRowGroup'
----
24
|