apache / apache/datafusion

Default generated column name is confusing on casts

Open
#4,723 1 comment 1 reaction 0 assignees 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? Please describe what you are trying to do.**
There were bunch of discussions that generated column names confusing, hard to read and hard to reuse in outer queries.
Apart from that they represents wrong types when cast happens, like in example below, the column name suggests its **Utf8** but in fact its **Date32**

```
❯ select date '2000-01-01', arrow_typeof(date '2000-01-01');
+--------------------+---------------------------------+
| Utf8("2000-01-01") | arrowtypeof(Utf8("2000-01-01")) |
+--------------------+---------------------------------+
| 2000-01-01 | Date32 |
+--------------------+---------------------------------+
```

There were some proposals on column naming standard https://github.com/apache/arrow-datafusion/issues/3990
@andygrove highlighted the part of the problem https://github.com/apache/arrow-datafusion/issues/3722

**Describe the solution you'd like**
Column names shouldn't be confusing

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Start by reading the column-naming discussion in issue #3990 and the problem context in #3722, then reproduce the SQL cast example from this issue in DataFusion. Done means an agreed, readable naming rule that avoids misleading generated names and reflects the actual cast type.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.