You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Jacky Du <ja...@gmail.com> on 2019/07/30 20:46:26 UTC

issue on Flink 1.6.2 for Table API when table schema contains nested ObjectArray

hi,

I Have column not found exception when issue running a simple FLink query
against Flink Table API on Flink 1.6.2.

exception log:

Caused by: org.apache.calcite.sql.validate.SqlValidatorException:
Column 'data.interaction.action_type' not found in table 'mycable'

When I changed Flink version back to 1.5.2, it's working again. and I found
that mytable schema has an objectarray , which is a nullable value , when I
removed that array definition , the query working again in 1.6.2 .

Table query:

SELECT * FROM mycable WHERE data.interaction.action_type ='Complete'
or data.interaction.action_type ='Cancelled'

Table schema:

 |-- data: Row(attributeList: ObjectArrayTypeInfo<Row(product:
Row(status: String), value: String)>, interaction: Row(action_type:
String), tool: Row(ticket_number: String), customerAccount:
Row(billingId: String), info: Row(timestamp: BigDecimal))
 |-- entityId: String
 |-- eventType: String
 |-- eventSource: String
 |-- timestamp: String
 |-- encryption: Row(status: String)

If I remove that objectarray , which is attributeList in data field . The
query working , schema like this : Table schema:

 |-- data: Row(interaction: Row(action_type: String), tool:
Row(ticket_number: String), customerAccount: Row(billingId: String),
info: Row(timestamp: BigDecimal))
 |-- entityId: String
 |-- eventType: String
 |-- eventSource: String
 |-- timestamp: String
 |-- encryption: Row(status: String)

Or, I even changed the order of objectarray in the data field, it's working
.

I'm so confused about this issue, I tried to understand why this happened ,
tried to read the Flink source code as well , but can not find the root
cause .