mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-11 22:42:02 +00:00
Support optional table for ANALYZE
statement (#1599)
This commit is contained in:
parent
6523dabcf8
commit
eae5629fb8
4 changed files with 16 additions and 2 deletions
|
@ -2354,6 +2354,7 @@ pub enum Statement {
|
|||
cache_metadata: bool,
|
||||
noscan: bool,
|
||||
compute_statistics: bool,
|
||||
has_table_keyword: bool,
|
||||
},
|
||||
/// ```sql
|
||||
/// TRUNCATE
|
||||
|
@ -3651,8 +3652,13 @@ impl fmt::Display for Statement {
|
|||
cache_metadata,
|
||||
noscan,
|
||||
compute_statistics,
|
||||
has_table_keyword,
|
||||
} => {
|
||||
write!(f, "ANALYZE TABLE {table_name}")?;
|
||||
write!(
|
||||
f,
|
||||
"ANALYZE{}{table_name}",
|
||||
if *has_table_keyword { " TABLE " } else { " " }
|
||||
)?;
|
||||
if let Some(ref parts) = partitions {
|
||||
if !parts.is_empty() {
|
||||
write!(f, " PARTITION ({})", display_comma_separated(parts))?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue