mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-26 23:49:10 +00:00
DuckDB: Allow quoted date parts in EXTRACT (#2030)
Some checks failed
license / Release Audit Tool (RAT) (push) Has been cancelled
Rust / codestyle (push) Has been cancelled
Rust / lint (push) Has been cancelled
Rust / benchmark-lint (push) Has been cancelled
Rust / compile (push) Has been cancelled
Rust / docs (push) Has been cancelled
Rust / compile-no-std (push) Has been cancelled
Rust / test (beta) (push) Has been cancelled
Rust / test (nightly) (push) Has been cancelled
Rust / test (stable) (push) Has been cancelled
Some checks failed
license / Release Audit Tool (RAT) (push) Has been cancelled
Rust / codestyle (push) Has been cancelled
Rust / lint (push) Has been cancelled
Rust / benchmark-lint (push) Has been cancelled
Rust / compile (push) Has been cancelled
Rust / docs (push) Has been cancelled
Rust / compile-no-std (push) Has been cancelled
Rust / test (beta) (push) Has been cancelled
Rust / test (nightly) (push) Has been cancelled
Rust / test (stable) (push) Has been cancelled
This commit is contained in:
parent
7021561474
commit
f642dd573c
2 changed files with 11 additions and 0 deletions
|
@ -70,6 +70,11 @@ impl Dialect for DuckDbDialect {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if this dialect allows the `EXTRACT` function to use single quotes in the part being extracted.
|
||||||
|
fn allow_extract_single_quotes(&self) -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
// DuckDB is compatible with PostgreSQL syntax for this statement,
|
// DuckDB is compatible with PostgreSQL syntax for this statement,
|
||||||
// although not all features may be implemented.
|
// although not all features may be implemented.
|
||||||
fn supports_explain_with_utility_options(&self) -> bool {
|
fn supports_explain_with_utility_options(&self) -> bool {
|
||||||
|
|
|
@ -869,3 +869,9 @@ fn test_duckdb_trim() {
|
||||||
duckdb().parse_sql_statements(error_sql).unwrap_err()
|
duckdb().parse_sql_statements(error_sql).unwrap_err()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_extract_single_quotes() {
|
||||||
|
let sql = "SELECT EXTRACT('month' FROM my_timestamp) FROM my_table";
|
||||||
|
duckdb().verified_stmt(sql);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue