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

Jark Wu commented on FLINK-30746:
---------------------------------

The exception is very clear, the column order is mismatched. In the query 
schema, the {{enrichment}} column is at position 3, but in the sink schema, the 
{{enrichment}} column is at position 2.

> Flink Table / SQL Column types of query result and sink for do not match, but 
> should
> ------------------------------------------------------------------------------------
>
>                 Key: FLINK-30746
>                 URL: https://issues.apache.org/jira/browse/FLINK-30746
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 1.16.0
>            Reporter: Colin Williams
>            Priority: Major
>
> For the branch `table-example` in the `table-example` directory 
> [https://github.com/apple-corps/recipes/tree/table-example/table-example] we 
> provide a test job 
> [https://github.com/apple-corps/recipes/blob/table-example/table-example/src/test/java/TableJobTest.java]
> When we run the job, for example with `mvn install` we get:
> ```
> org.apache.flink.table.api.ValidationException: 
> Column types of query result and sink for 
> 'temporaryCatalog.default.enrichmentOut' do not match.
> Cause: Incompatible types for sink column 'enrichment' at position 2.
> Query schema: [id: STRING NOT NULL, status: STRING NOT NULL, ts: TIMESTAMP(3) 
> *ROWTIME*, enrichment: STRING NOT NULL]
> Sink schema:  [id: STRING, status: STRING, enrichment: STRING, ts: 
> TIMESTAMP(3)]
>     at TableJobTest.testExecuteSQL(TableJobTest.java:83)
> ```
> However by the schemas the sink schema should be showing compatible types. 
> [https://github.com/apple-corps/recipes/blob/table-example/table-example/src/main/java/com/immerok/cookbook/schemas/Schemas.java]
> One curiousity is the *ROWTIME* which we see in the Query Schema but not in 
> the Sink schema.
> This issue has been discussed in 
> [https://apache-flink.slack.com/archives/C03G7LJTS2G/p1673979671298779]



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

Reply via email to