apache / apache/datafusion

The return type of EXTRACT

Open
#1,992 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

I think the result type of u32 is not enough.
From the spark,
```
spark-sql> SELECT EXTRACT(YEAR FROM TIMESTAMP '-2000-12-16 12:21:13');
-2000
```
But this is not related to this issue, I will open a follow up pull request and discuss the returned type.

_Originally posted by @liukun4515 in https://github.com/apache/arrow-datafusion/pull/1991#r824743599_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the EXTRACT(YEAR FROM TIMESTAMP '-2000-12-16 12:21:13') query and compare its returned type and value with the Spark SQL example in the issue. Locate the EXTRACT implementation and its existing tests; done means negative years are represented without the reported u32 limitation and the relevant test coverage passes.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.