Skip to content

Commit

Permalink
fix: analyze table contain keyword bug (#17131)
Browse files Browse the repository at this point in the history
fix analyze contain keyword
  • Loading branch information
zhyass authored Dec 27, 2024
1 parent 5f3afe0 commit 962dda0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,16 @@ impl Interpreter for AnalyzeTableInterpreter {
)
};

let quote = self
.ctx
.get_settings()
.get_sql_dialect()?
.default_ident_quote();
let index_cols: Vec<(u32, String)> = schema
.fields()
.iter()
.filter(|f| RangeIndex::supported_type(&f.data_type().into()))
.map(|f| (f.column_id(), f.name.clone()))
.map(|f| (f.column_id(), format!("{quote}{}{quote}", f.name)))
.collect();

// 0.01625 --> 12 buckets --> 4K size per column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ CREATE DATABASE db_09_0020
statement ok
USE db_09_0020

statement ok
create or replace table t_17129(`offset` varchar);

statement ok
insert into t_17129 values('ttt');

statement ok
analyze table t_17129;

query TI
select column_name, distinct_count from fuse_statistic('db_09_0020','t_17129');
----
offset 1

statement ok
drop table t_17129;

statement ok
create table t(a uint64)

Expand Down

0 comments on commit 962dda0

Please sign in to comment.