[
https://issues.apache.org/jira/browse/FLINK-37753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17948937#comment-17948937
]
david radley edited comment on FLINK-37753 at 5/2/25 4:08 PM:
--------------------------------------------------------------
[~martijnvisser] I had a look around and see Mariadb returns a null in the case
of errors (and 0 in older versions) see
[https://mariadb.com/kb/en/unix_timestamp/] ; we might want to return null as
there is precedent. nulls are more easy for the SQL developer to handle than
errors.
I notice that [the code that does
this|https://github.com/apache/flink/blob/412fc8c124f3ae4da64d28b4042680b25857bde1/flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/DateTimeUtils.java#L1466]
has a primitive long returned. So the table API is likely to have a long
returned, so null may not be possible to return.
WDYT?
was (Author: JIRAUSER300523):
[~martijnvisser] I had a look around and see Mariadb returns a null in the case
of errors like [https://mariadb.com/kb/en/unix_timestamp/] ; we might want to
copy this as there is precedent. nulls are more easy for the SQL developer to
handle than errors.
I notice that [the code that does
this|https://github.com/apache/flink/blob/412fc8c124f3ae4da64d28b4042680b25857bde1/flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/DateTimeUtils.java#L1466]
has a primitive long returned. So the table API is likely to have a long
returned, so null may not be possible to return.
WDYT?
> Improve error handling for UNIX_TIMESTAMP
> -----------------------------------------
>
> Key: FLINK-37753
> URL: https://issues.apache.org/jira/browse/FLINK-37753
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / API
> Reporter: Martijn Visser
> Priority: Major
>
> Right now, running a UNIX_TIMESTAMP like:
> {code:sql}
> SELECT UNIX_TIMESTAMP('2025-04-30T19:20:17Z');
> {code}
> Returns a value like
> {noformat}
> -9223372036854776000
> {noformat}
> Instead of returning the minimum of a LONG, we could return an error because
> the format is not according to the provider (in this case, the default) format
--
This message was sent by Atlassian Jira
(v8.20.10#820010)