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

Ingo Bürk commented on FLINK-23933:
-----------------------------------

I think you're describing some (new) concept of computed columns on the 
"implicit" record, though I don't know what that would mean (what does that 
function operate on?). It'd certainly not be limited to JSON since this would 
be introducing new SQL syntax.

Can't this issue also just be solved by making sure that the JSON format can 
cast to the expected schema? I'm not sure how that works implementation-wise 
with Jackson, but it seems like a very intuitive / idiomatic way to address 
this issue without introducing new syntax, or losing any support of the format 
options.

> flink-json formats support a option to parse nested json as a String
> --------------------------------------------------------------------
>
>                 Key: FLINK-23933
>                 URL: https://issues.apache.org/jira/browse/FLINK-23933
>             Project: Flink
>          Issue Type: Improvement
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile)
>    Affects Versions: 1.13.2
>            Reporter: Shengnan YU
>            Priority: Major
>
> When use Flink SQL to read message with nested json, eg. \{"a":{"b":111, 
> "c":"xxx"}, "d":12345},The nested field must be specified ROW or MAP in the 
> table schema.
> {code:sql}
> CREATE TABLE input(
>     a ROW(`b`: BIGINT, `c` VARCHAR),
>     d BIGINT
> )
> WITH ( 
>     'format' = 'json',
>     // ... 
> );
> {code}
> I'd like to create a option to allow we read the json-object type value as a 
> String.
> {code:sql}
> CREATE TABLE input (
>     a VARCHAR,
>     d VARCHAR
> )
> WITH ( 
>  'format' = 'json',
>  'json.forceStringFields' = 'a,d'
>  // ... 
> );
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to