Skip to content

change extract return types to decimal to align with postgres #3996

@waitingkuo

Description

@waitingkuo

extract currently returns i32 which might loss some information

select extract(second from timestamp '2000-01-01T00:00:00.1');
+--------------------------------------------------------+
| datepart(Utf8("SECOND"),Utf8("2000-01-01T00:00:00.1")) |
+--------------------------------------------------------+
| 0                                                      |
+--------------------------------------------------------+
1 row in set. Query took 0.000 seconds.

while postgresql returns decimal

willy=# select extract(second from timestamp '2000-01-01T00:00:00.1');
 extract  
----------
 0.100000
(1 row)

Describe the solution you'd like
A clear and concise description of what you want to happen.

change it to decimal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions