Skip to content

Commit

Permalink
Fix column name for COUNT(*) set by AggregateStatistics (#7757)
Browse files Browse the repository at this point in the history
This fixes the issue of column name COUNT(UInt8) appearing instead
Resolves #104
  • Loading branch information
qrilka committed Oct 6, 2023
1 parent a8c01de commit c0409a7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use crate::error::Result;
pub struct AggregateStatistics {}

/// The name of the column corresponding to [`COUNT_STAR_EXPANSION`]
const COUNT_STAR_NAME: &str = "COUNT(UInt8(1))";
const COUNT_STAR_NAME: &str = "COUNT(*)";

impl AggregateStatistics {
#[allow(missing_docs)]
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/tests/custom_sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ async fn optimizers_catch_all_statistics() {

let expected = RecordBatch::try_new(
Arc::new(Schema::new(vec![
Field::new("COUNT(UInt8(1))", DataType::Int64, false),
Field::new("COUNT(*)", DataType::Int64, false),
Field::new("MIN(test.c1)", DataType::Int32, false),
Field::new("MAX(test.c1)", DataType::Int32, false),
])),
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/tests/sql/explain_analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ async fn explain_physical_plan_only() {

let expected = vec![vec![
"physical_plan",
"ProjectionExec: expr=[2 as COUNT(UInt8(1))]\
"ProjectionExec: expr=[2 as COUNT(*)]\
\n EmptyExec: produce_one_row=true\
\n",
]];
Expand Down
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/test_files/explain.slt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ query TT
EXPLAIN select count(*) from (values ('a', 1, 100), ('a', 2, 150)) as t (c1,c2,c3)
----
physical_plan
ProjectionExec: expr=[2 as COUNT(UInt8(1))]
ProjectionExec: expr=[2 as COUNT(*)]
--EmptyExec: produce_one_row=true

statement ok
Expand Down

0 comments on commit c0409a7

Please sign in to comment.