Skip to content

Add test for datafusion.execution.collect_statistics setting - #16096

Closed
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/test_stats
Closed

Add test for datafusion.execution.collect_statistics setting#16096
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/test_stats

Conversation

@alamb

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

What changes are included in this PR?

Add a test showing the impact of setting datafusion.execution.collect_statistics via SQL

Are these changes tested?

Only tests

Are there any user-facing changes?

No, just tests

@alamb
alamb marked this pull request as draft May 19, 2025 13:13
@github-actionsgithub-actionsBot added the sqllogictest SQL Logic Tests (.slt) label May 19, 2025
01)CoalesceBatchesExec: target_batch_size=8192, statistics=[Rows=Absent, Bytes=Absent, [(Col[0]:)]]
02)--FilterExec: column1@0 = 1, statistics=[Rows=Absent, Bytes=Absent, [(Col[0]: Min=Exact(Int64(1)) Max=Exact(Int64(1)))]]
03)----RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=2, statistics=[Rows=Absent, Bytes=Absent, [(Col[0]:)]]
04)------DataSourceExec: file_groups={2 groups: [[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/scratch/parquet_statistics/test_table/0.parquet], [WORKSPACE_ROOT/datafusion/sqllogictest/test_files/scratch/parquet_statistics/test_table/1.parquet]]}, projection=[column1], file_type=parquet, predicate=column1@0 = 1, pruning_predicate=column1_null_count@2 != row_count@3 AND column1_min@0 <= 1 AND 1 <= column1_max@1, required_guarantees=[column1 in (1)]

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is incorrect -- the statistics should be present in this query

statement ok
set datafusion.explain.show_statistics = true;

# By default, the statistics are gathered

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# By default, the statistics are gathered
# By default, the statistics are NOT gathered

@alamb

Copy link
Copy Markdown
ContributorAuthor

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictestSQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@alamb