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

Yao Zhang commented on FLINK-28275:
-----------------------------------

Hi all,

It might not be a good practice to deserialize the data to javaObject in 
RowValueDataserializer::deserialize.

The root cause is in this case Flink tries to convert BinaryRawValueData to the 
backed object using RawValueDataSerializer. It should use 
RawValueDataSerializer.getInnerSerializer() instead.

However, if we introduced the dependency flink-table-runtime(where 
RawValueDataSerializer belongs to) to flink-table-common(BinaryRawValueData), 
we would get a circular dependency. We cannot do this.

Does anyone have any better ideas? Thanks.

> Table.execute().print() prints SqlRawValue
> ------------------------------------------
>
>                 Key: FLINK-28275
>                 URL: https://issues.apache.org/jira/browse/FLINK-28275
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 1.15.0
>         Environment: Flink 1.15
> Flink ML 2.1
>            Reporter: Yunfeng Zhou
>            Priority: Major
>
> If the following code is executed with Flink 1.15.0 and Flink ML 2.1
>  
> {code:java}
> import org.apache.flink.ml.linalg.Vectors;
> import org.apache.flink.streaming.api.datastream.DataStream;
> import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
> import org.apache.flink.table.api.Table;
> import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
> import org.apache.flink.types.Row;
> public class SqlRawValueExample {
> public static void main(String[] args) {
> StreamExecutionEnvironment env = 
> StreamExecutionEnvironment.getExecutionEnvironment();
> StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);
> DataStream<Row> dataStream = env.fromElements(Row.of(Vectors.dense(1.0, 
> 2.0)));
> Table table = tEnv.fromDataStream(dataStream);
> table.execute().print();
> }
> }{code}
>  
> The following result would be printed out
>  
> {code:java}
> +----+--------------------------------+
> | op |                             f0 |
> +----+--------------------------------+
> | +I |                 SqlRawValue{?} |
> +----+--------------------------------+{code}
>  
> while the expected result is 
> {code:java}
> +----+--------------------------------+
> | op |                             f0 |
> +----+--------------------------------+
> | +I |                     [1.0, 2.0] |
> +----+--------------------------------+{code}
> This behavior affects the readability of the generated results.
>  



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

Reply via email to