File: physical_operator_logging.test_slow

package info (click to toggle)
duckdb 1.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 564
file content (71 lines) | stat: -rw-r--r-- 2,043 bytes parent folder | download | duplicates (3)
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