[
https://issues.apache.org/jira/browse/FLINK-13603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16902541#comment-16902541
]
Yu Du commented on FLINK-13603:
-------------------------------
Find maybe the root cause of this issue :
>From Flink-1.5 to Flink 1.6 ,
RowTypeInfo.java changed the equal behavior , in 1.5
public int hashCode() {
return 31 * super.hashCode() + Arrays.hashCode(fieldNames);
}
changed to 1.6
public int hashCode() {
return 31 * super.hashCode();
}
so it won't compare the fieldNames any more , this cause in
FlinkTypeFactory.scala , when load the RowType with same structure but
different name as the same type . and then cause the issue when mapping from
field name to field type .
let me know if I'm wrong , if this is the root cause , can it be fixed in the
next Flink release ?
> Flink Table ApI not working with nested Json schema starting From 1.6.x
> -----------------------------------------------------------------------
>
> Key: FLINK-13603
> URL: https://issues.apache.org/jira/browse/FLINK-13603
> Project: Flink
> Issue Type: Bug
> Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile), Table
> SQL / API
> Affects Versions: 1.6.4, 1.7.2, 1.8.1
> Reporter: Yu Du
> Priority: Major
> Labels: bug
> Attachments: FlinkTableBugCode, jsonSchema.json, jsonSchema2.json,
> schema_mapping_error_screenshot .png
>
>
> starting from Flink 1.6.2 , some schema not working when have nested object .
> issue like : Caused by:
> org.apache.calcite.sql.validate.SqlValidatorException: Column
> 'data.interaction.action_type' not found in table
> Even we can see that column from Table Schema .
> And the same schema and query working on 1.5.2 , but not working for 1.6.x ,
> 1.7.x and 1.8.x
>
> I tried to dive into the bug, and found the root cause is calcite library
> doesn't mapping the column name with the correct Row type .
> I checked Flink 1.6 using the same version of Calcite as Flink 1.5 . Not
> sure if Calcite is the root cause of this issue .
> Attached with the code sample and two issue json schemas . both examples give
> column not found exception .
>
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)