[
https://issues.apache.org/jira/browse/FLINK-22260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17320159#comment-17320159
]
Jark Wu edited comment on FLINK-22260 at 4/13/21, 1:03 PM:
-----------------------------------------------------------
{{LIKE}} will not derive computed columns by default, so the query schema
doesn't match physical columns if source has computed columns.
Could you check whether the name and ts columns are both computed column?
was (Author: jark):
{{LIKE}} will not derive computed columns by default, so the query schema
doesn't match physical columns if source has computed columns.
Could you check the name and ts columns are both computed column?
> Source schema in CREATE TABLE LIKE statements is not inferred correctly
> -----------------------------------------------------------------------
>
> Key: FLINK-22260
> URL: https://issues.apache.org/jira/browse/FLINK-22260
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API
> Reporter: Ingo Bürk
> Assignee: Ingo Bürk
> Priority: Blocker
> Fix For: 1.13.0
>
>
> When using a LIKE statement such as in the following (assume some_sink and
> some_source to be two tables with the same schema)
> {code:java}
> CREATE TEMPORARY TABLE b LIKE some_sink
> INSERT INTO b SELECT * FROM some_source{code}
> the source schema for the INSERT operation is not actually inferred
> correctly, causing the entire query to fail:
> {quote}org.apache.flink.table.api.ValidationException: Column types of query
> result and sink for registered table 'default.default.b' do not match.
> Cause: Different number of columns.
> Query schema: [name: STRING, ts: TIMESTAMP(3) *ROWTIME*]
> Sink schema: []
> {quote}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)