apache / apache/datafusion

Extend `sqllogictest` framework to uptake custom `datafusion.format.*` settings

Open
#21,447 1 comment 0 reactions 1 assignee Claimed by @erenavsarogullari View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

**Ref Discussion:** https://github.com/apache/datafusion/pull/21355#discussion_r3035659443
Currently, sqllogictest framework does not support custom datafusion.format.* configs updates and it always runs the tests with default format settings and the results as follows:
**Current Behavior:**
```
statement ok
SET datafusion.format.date_format = '%d-%m-%Y'

query D
SELECT DATE '2024-03-15'
----
Returns 2024-03-15 instead of 15-03-2024
```

The reason is that `sqllogictest` framework needs to be extended in order to uptake `datafusion.format.*` settings by `SessionContext` instead default format settings: https://github.com/apache/datafusion/blob/main/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs#L239 like following expected behavior. This ticket aims to address this extension and add additional functional coverages for `datafusion.format.*` configs.

**Expected Behavior:**
```
statement ok
SET datafusion.format.date_format = '%d-%m-%Y'

query D
SELECT DATE '2024-03-15'
----
15-03-2024

statement ok
RESET datafusion.format.date_format

query D
SELECT DATE '2024-03-15'
----
2024-03-15
```

### Describe the solution you'd like

Explained at the first section.

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.