Skip to content

Commit 111ff7e

Browse files
authored
minor: Update docs and error messages about what SQL dialects are supported (#14893)
* . * revert fmt change by vscode * prettier
1 parent 7119ee8 commit 111ff7e

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

datafusion-cli/src/exec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub(super) async fn exec_and_print(
222222
plan_datafusion_err!(
223223
"Unsupported SQL dialect: {dialect}. Available dialects: \
224224
Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, \
225-
MsSQL, ClickHouse, BigQuery, Ansi."
225+
MsSQL, ClickHouse, BigQuery, Ansi, DuckDB, Databricks."
226226
)
227227
})?;
228228

@@ -520,7 +520,7 @@ mod tests {
520520
plan_datafusion_err!(
521521
"Unsupported SQL dialect: {dialect}. Available dialects: \
522522
Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, \
523-
MsSQL, ClickHouse, BigQuery, Ansi."
523+
MsSQL, ClickHouse, BigQuery, Ansi, DuckDB, Databricks."
524524
)
525525
})?;
526526
for location in locations {

datafusion/common/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ config_namespace! {
242242
pub enable_options_value_normalization: bool, warn = "`enable_options_value_normalization` is deprecated and ignored", default = false
243243

244244
/// Configure the SQL dialect used by DataFusion's parser; supported values include: Generic,
245-
/// MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, MsSQL, ClickHouse, BigQuery, and Ansi.
245+
/// MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, MsSQL, ClickHouse, BigQuery, Ansi, DuckDB and Databricks.
246246
pub dialect: String, default = "generic".to_string()
247247
// no need to lowercase because `sqlparser::dialect_from_str`] is case-insensitive
248248

datafusion/core/src/execution/session_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ impl SessionState {
480480
plan_datafusion_err!(
481481
"Unsupported SQL dialect: {dialect}. Available dialects: \
482482
Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, \
483-
MsSQL, ClickHouse, BigQuery, Ansi."
483+
MsSQL, ClickHouse, BigQuery, Ansi, DuckDB, Databricks."
484484
)
485485
})?;
486486
let mut statements = DFParser::parse_sql_with_dialect(sql, dialect.as_ref())?;
@@ -518,7 +518,7 @@ impl SessionState {
518518
plan_datafusion_err!(
519519
"Unsupported SQL dialect: {dialect}. Available dialects: \
520520
Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, \
521-
MsSQL, ClickHouse, BigQuery, Ansi."
521+
MsSQL, ClickHouse, BigQuery, Ansi, DuckDB, Databricks."
522522
)
523523
})?;
524524

datafusion/sqllogictest/test_files/information_schema.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ datafusion.optimizer.repartition_windows true Should DataFusion repartition data
355355
datafusion.optimizer.skip_failed_rules false When set to true, the logical plan optimizer will produce warning messages if any optimization rules produce errors and then proceed to the next rule. When set to false, any rules that produce errors will cause the query to fail
356356
datafusion.optimizer.top_down_join_key_reordering true When set to true, the physical plan optimizer will run a top down process to reorder the join keys
357357
datafusion.sql_parser.collect_spans false When set to true, the source locations relative to the original SQL query (i.e. [`Span`](sqlparser::tokenizer::Span)) will be collected and recorded in the logical plan nodes.
358-
datafusion.sql_parser.dialect generic Configure the SQL dialect used by DataFusion's parser; supported values include: Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, MsSQL, ClickHouse, BigQuery, and Ansi.
358+
datafusion.sql_parser.dialect generic Configure the SQL dialect used by DataFusion's parser; supported values include: Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, MsSQL, ClickHouse, BigQuery, Ansi, DuckDB and Databricks.
359359
datafusion.sql_parser.enable_ident_normalization true When set to true, SQL parser will normalize ident (convert ident to lowercase when not quoted)
360360
datafusion.sql_parser.enable_options_value_normalization false When set to true, SQL parser will normalize options value (convert value to lowercase). Note that this option is ignored and will be removed in the future. All case-insensitive values are normalized automatically.
361361
datafusion.sql_parser.parse_float_as_decimal false When set to true, SQL parser will parse float as decimal type

docs/source/user-guide/configs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@ Environment variables are read during `SessionConfig` initialisation so they mus
125125
| datafusion.sql_parser.parse_float_as_decimal | false | When set to true, SQL parser will parse float as decimal type |
126126
| datafusion.sql_parser.enable_ident_normalization | true | When set to true, SQL parser will normalize ident (convert ident to lowercase when not quoted) |
127127
| datafusion.sql_parser.enable_options_value_normalization | false | When set to true, SQL parser will normalize options value (convert value to lowercase). Note that this option is ignored and will be removed in the future. All case-insensitive values are normalized automatically. |
128-
| datafusion.sql_parser.dialect | generic | Configure the SQL dialect used by DataFusion's parser; supported values include: Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, MsSQL, ClickHouse, BigQuery, and Ansi. |
128+
| datafusion.sql_parser.dialect | generic | Configure the SQL dialect used by DataFusion's parser; supported values include: Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, MsSQL, ClickHouse, BigQuery, Ansi, DuckDB and Databricks. |
129129
| datafusion.sql_parser.support_varchar_with_length | true | If true, permit lengths for `VARCHAR` such as `VARCHAR(20)`, but ignore the length. If false, error if a `VARCHAR` with a length is specified. The Arrow type system does not have a notion of maximum string length and thus DataFusion can not enforce such limits. |
130130
| datafusion.sql_parser.collect_spans | false | When set to true, the source locations relative to the original SQL query (i.e. [`Span`](sqlparser::tokenizer::Span)) will be collected and recorded in the logical plan nodes. |

0 commit comments

Comments
 (0)