[ 
https://issues.apache.org/jira/browse/FLINK-24924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17445660#comment-17445660
 ] 

Jark Wu commented on FLINK-24924:
---------------------------------

> I agree that exceptions are not optimal for streaming pipelines. But even for 
> batch jobs, this is a reoccurring problem. Take a batch job for example that 
> runs every night and suddenly produces an exception due to some corrupt data 
> in the current batch. It is basically the same problem.

I don't think so. It's very easy for batch jobs to update SQL and re-run. 
However, this is super hard for streaming jobs,  because the state may not 
compatible and the source may expired the needed data. 


"COALESCE(CAST('aa' AS INT), 0) => NULL" is a bug of return type of CAST, we 
should fix the result type signatures of all functions which returning null. 
I think it's not a bad case or hard to explain for returning null. 





> TO_TIMESTAMP and TO_DATE should fail
> ------------------------------------
>
>                 Key: FLINK-24924
>                 URL: https://issues.apache.org/jira/browse/FLINK-24924
>             Project: Flink
>          Issue Type: Sub-task
>            Reporter: Francesco Guardiani
>            Priority: Major
>
> In a similar fashion to what described 
> https://issues.apache.org/jira/browse/FLINK-24385, TO_TIMESTAMP and TO_DATE 
> should fail instead of returning {{null}}.
> In particular for these two functions, a failure in parsing could lead to 
> very unexpected behavior, for example it could lead to records with null 
> rowtime.
> We should change these functions to fail by default when parsing generates an 
> error. We can let users handle errors by letting them use TRY_CAST for the 
> same functionality:
> {code:sql}
> -- This fails when input is invalid
> TO_TIMESTAMP(input)
> -- Behaves the same as above
> CAST(input AS TIMESTAMP)
> -- This returns null when input is invalid
> TRY_CAST(input AS TIMESTAMP)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to