apache / apache/datafusion

Support `from_unixtime(ts, [fmt])`

Open
#16,577 14 comments 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?

Currently Datafusion supports `from_unixtime(timestamp)`, would be good to have another variant
`from_unixtime(timestamp, format)`

```
SELECT from_unixtime(0, 'yyyy-MM-dd HH:mm:ss');
1969-12-31 16:00:00
```

The format handling as the reference can be taken from `to_timestamp` builtin function

### Describe the solution you'd like

_No response_

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing from_unixtime and to_timestamp builtin-function entry points and their tests. Verify how the current one-argument function handles formatting, then use the provided SQL example as the completion criterion while preserving existing behavior and adding coverage for the two-argument form.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.