Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions datafusion/core/tests/sql/information_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,15 +693,23 @@ async fn show_all() {

let results = plan_and_collect(&ctx, sql).await.unwrap();

let expected_length = ctx
.state
.read()
.config
.config_options
.read()
.options()
.len();
assert_eq!(expected_length, results[0].num_rows());
// Has all the default values, should be in order by name
let expected = vec![
"+-------------------------------------------------+---------+",
"| name | setting |",
"+-------------------------------------------------+---------+",
"| datafusion.execution.batch_size | 8192 |",
"| datafusion.execution.coalesce_batches | true |",
"| datafusion.execution.coalesce_target_batch_size | 4096 |",
"| datafusion.execution.time_zone | UTC |",
"| datafusion.explain.logical_plan_only | false |",
"| datafusion.explain.physical_plan_only | false |",
"| datafusion.optimizer.filter_null_join_keys | false |",
"| datafusion.optimizer.skip_failed_rules | true |",
"+-------------------------------------------------+---------+",
];

assert_batches_eq!(expected, &results);
}

#[tokio::test]
Expand Down
5 changes: 4 additions & 1 deletion datafusion/sql/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2416,7 +2416,10 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
let variable_lower = variable.to_lowercase();

let query = if variable_lower == "all" {
String::from("SELECT name, setting FROM information_schema.df_settings")
// Add an ORDER BY so the output comes out in a consistent order
String::from(
"SELECT name, setting FROM information_schema.df_settings ORDER BY name",
)
} else if variable_lower == "timezone" || variable_lower == "time.zone" {
// we could introduce alias in OptionDefinition if this string matching thing grows
String::from("SELECT name, setting FROM information_schema.df_settings WHERE name = 'datafusion.execution.time_zone'")
Expand Down