Ramin Gharib created FLINK-39869:
------------------------------------

             Summary: Validate literal charset at planning time for ENCODE and 
drop the runtime warning
                 Key: FLINK-39869
                 URL: https://issues.apache.org/jira/browse/FLINK-39869
             Project: Flink
          Issue Type: Sub-task
          Components: Table SQL / API, Table SQL / Planner, Table SQL / Runtime
            Reporter: Ramin Gharib
            Assignee: Ramin Gharib


{{{}ENCODE(str, charset{}}}) logs a per-row {{LOG.warn}} and falls back to 
UTF-8 when the charset is unsupported ({{{}strToBytesWithCharset{}}}, ~line 
581). The charset argument is typically a literal.

Add an {{EncodeInputTypeStrategy}} that, when the charset argument is a 
non-null literal, rejects an unsupported charset with a {{ValidationException}} 
at planning time. Use {{Charset.isSupported(...)}} for the check. This mirrors 
the literal-validation pattern from FLINK-39648. Remove the per-row 
{{{}LOG.warn{}}}. Non-literal charset values keep the existing runtime 
fallback.                                                                       
                                                                                
                                                                 
Consider {{DECODE}} for parity, since it shares the charset argument.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to