Skip to content

Commit 1454ade

Browse files
committed
Fix sqllogictest
1 parent 2b9d97c commit 1454ade

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,10 @@ pub fn cell_to_string(col: &ArrayRef, row: usize) -> Result<String> {
239239
Ok(cell_to_string(dict.values(), key)?)
240240
}
241241
_ => {
242-
let f = ArrayFormatter::try_new(col.as_ref(), &DEFAULT_FORMAT_OPTIONS);
242+
let f = ArrayFormatter::try_new(
243+
col.as_ref(),
244+
&DEFAULT_FORMAT_OPTIONS.with_null("NULL"),
245+
);
243246
Ok(f.unwrap().value(row).to_string())
244247
}
245248
}

datafusion/sqllogictest/test_files/information_schema.slt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,15 @@ datafusion.explain.physical_plan_only false
272272
datafusion.explain.show_schema false
273273
datafusion.explain.show_sizes true
274274
datafusion.explain.show_statistics false
275+
datafusion.format.date_format NULL
276+
datafusion.format.datetime_format NULL
277+
datafusion.format.duration_format pretty
278+
datafusion.format.null (empty)
279+
datafusion.format.safe true
280+
datafusion.format.time_format NULL
281+
datafusion.format.timestamp_format NULL
282+
datafusion.format.timestamp_tz_format NULL
283+
datafusion.format.types_info false
275284
datafusion.optimizer.allow_symmetric_joins_without_pruning true
276285
datafusion.optimizer.default_filter_selectivity 20
277286
datafusion.optimizer.enable_distinct_aggregation_soft_limit true
@@ -366,12 +375,21 @@ datafusion.execution.split_file_groups_by_statistics false Attempt to eliminate
366375
datafusion.execution.target_partitions 7 Number of partitions for query execution. Increasing partitions can increase concurrency. Defaults to the number of CPU cores on the system
367376
datafusion.execution.time_zone +00:00 The default time zone Some functions, e.g. `EXTRACT(HOUR from SOME_TIME)`, shift the underlying datetime according to this time zone, and then extract the hour
368377
datafusion.execution.use_row_number_estimates_to_optimize_partitioning false Should DataFusion use row number estimates at the input to decide whether increasing parallelism is beneficial or not. By default, only exact row numbers (not estimates) are used for this decision. Setting this flag to `true` will likely produce better plans. if the source of statistics is accurate. We plan to make this the default in the future.
369-
datafusion.explain.format indent Display format of explain. Default is "indent". When set to "tree", it will print the plan in a tree-rendered format.
378+
datafusion.explain.format indent Display format of explain. Default is "indent". When set to "tree", it will print the plan in a tree-rendered format. No need to normalize because ExplainFormat is case-insensitive
370379
datafusion.explain.logical_plan_only false When set to true, the explain statement will only print logical plans
371380
datafusion.explain.physical_plan_only false When set to true, the explain statement will only print physical plans
372381
datafusion.explain.show_schema false When set to true, the explain statement will print schema information
373382
datafusion.explain.show_sizes true When set to true, the explain statement will print the partition sizes
374383
datafusion.explain.show_statistics false When set to true, the explain statement will print operator statistics for physical plans
384+
datafusion.format.date_format NULL Date format for date arrays
385+
datafusion.format.datetime_format NULL Format for DateTime arrays
386+
datafusion.format.duration_format pretty Duration format. Can be either Pretty or ISO8601
387+
datafusion.format.null (empty) Format string for nulls
388+
datafusion.format.safe true If set to `true` any formatting errors will be written to the output instead of being converted into a [`std::fmt::Error`]
389+
datafusion.format.time_format NULL Time format for time arrcays
390+
datafusion.format.timestamp_format NULL Timestamp format for timestamp arrays
391+
datafusion.format.timestamp_tz_format NULL Timestamp format for timestamp with timezone arrays
392+
datafusion.format.types_info false Show types in visual representation batches
375393
datafusion.optimizer.allow_symmetric_joins_without_pruning true Should DataFusion allow symmetric hash joins for unbounded data sources even when its inputs do not have any ordering or filtering If the flag is not enabled, the SymmetricHashJoin operator will be unable to prune its internal buffers, resulting in certain join types - such as Full, Left, LeftAnti, LeftSemi, Right, RightAnti, and RightSemi - being produced only at the end of the execution. This is not typical in stream processing. Additionally, without proper design for long runner execution, all types of joins may encounter out-of-memory errors.
376394
datafusion.optimizer.default_filter_selectivity 20 The default filter selectivity used by Filter Statistics when an exact selectivity cannot be determined. Valid values are between 0 (no selectivity) and 100 (all rows are selected).
377395
datafusion.optimizer.enable_distinct_aggregation_soft_limit true When set to true, the optimizer will push a limit operation into grouped aggregations which have no aggregate expressions, as a soft limit, emitting groups once the limit is reached, before all rows in the group are read.

0 commit comments

Comments
 (0)