insert overwrite 问题

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

insert overwrite 问题

潘明文
您好,
    sql 出现以下错误,是什么原因造成的呀?


    Flink SQL> insert overwrite pmw select '1';
[INFO] Submitting SQL update statement to the cluster...
[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.table.api.TableException: Stream Tables can only be emitted by AppendStreamTableSink, RetractStreamTableSink, or UpsertStreamTableSink.
Reply | Threaded
Open this post in threaded view
|

Re: insert overwrite 问题

Benchao Li
Hi 明文,

现在insert overwrite应该是只支持HiveTableSink。所以如果你不是HiveTableSink的话,可以直接用“insert
into ..."就可以了。

潘明文 <[hidden email]> 于2020年2月16日周日 上午8:38写道:

> 您好,
>     sql 出现以下错误,是什么原因造成的呀?
>
>
>     Flink SQL> insert overwrite pmw select '1';
> [INFO] Submitting SQL update statement to the cluster...
> [ERROR] Could not execute SQL statement. Reason:
> org.apache.flink.table.api.TableException: Stream Tables can only be
> emitted by AppendStreamTableSink, RetractStreamTableSink, or
> UpsertStreamTableSink.



--

Benchao Li
School of Electronics Engineering and Computer Science, Peking University
Tel:+86-15650713730
Email: [hidden email]; [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: insert overwrite 问题

Jark
Administrator
Hi 明文,

第一个问题,请问你的 pmw 是什么表呢? 需要检查下其 TableSink 没有实现 AppendStreamTableSink,
RetractStreamTableSink, or UpsertStreamTableSink 任意一个接口。
第二个问题,如果要支持 insert overwrite,需要对应的 TableSink 实现  OverwritableTableSink 接口。
目前 CsvTableSink 没有实现这个接口。


Best,
Jark




On Sun, 16 Feb 2020 at 09:27, Benchao Li <[hidden email]> wrote:

> Hi 明文,
>
> 现在insert overwrite应该是只支持HiveTableSink。所以如果你不是HiveTableSink的话,可以直接用“insert
> into ..."就可以了。
>
> 潘明文 <[hidden email]> 于2020年2月16日周日 上午8:38写道:
>
> > 您好,
> >     sql 出现以下错误,是什么原因造成的呀?
> >
> >
> >     Flink SQL> insert overwrite pmw select '1';
> > [INFO] Submitting SQL update statement to the cluster...
> > [ERROR] Could not execute SQL statement. Reason:
> > org.apache.flink.table.api.TableException: Stream Tables can only be
> > emitted by AppendStreamTableSink, RetractStreamTableSink, or
> > UpsertStreamTableSink.
>
>
>
> --
>
> Benchao Li
> School of Electronics Engineering and Computer Science, Peking University
> Tel:+86-15650713730
> Email: [hidden email]; [hidden email]
>
Reply | Threaded
Open this post in threaded view
|

Re:Re: insert overwrite 问题

潘明文
In reply to this post by Benchao Li


   HI ,
    HiveTableSink正对HIVE 种创建的表可以是吗? 但我用HIVE 创建表的(表是在HIVE 中创建的),FLINK SQL 中直接使用HIVE 表
Flink SQL> INSERT INTO hive_test select '11';
[INFO] Submitting SQL update statement to the cluster...
[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.table.api.TableException: Stream Tables can only be emitted by AppendStreamTableSink, RetractStreamTableSink, or UpsertStreamTableSink.
Flink SQL> INSERT overwrite  hive_test select '11';    
[INFO] Submitting SQL update statement to the cluster...
[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.table.api.TableException: Stream Tables can only be emitted by AppendStreamTableSink, RetractStreamTableSink, or UpsertStreamTableSink.
 







在 2020-02-16 09:27:29,"Benchao Li" <[hidden email]> 写道:

>Hi 明文,
>
>现在insert overwrite应该是只支持HiveTableSink。所以如果你不是HiveTableSink的话,可以直接用“insert
>into ..."就可以了。
>
>潘明文 <[hidden email]> 于2020年2月16日周日 上午8:38写道:
>
>> 您好,
>>     sql 出现以下错误,是什么原因造成的呀?
>>
>>
>>     Flink SQL> insert overwrite pmw select '1';
>> [INFO] Submitting SQL update statement to the cluster...
>> [ERROR] Could not execute SQL statement. Reason:
>> org.apache.flink.table.api.TableException: Stream Tables can only be
>> emitted by AppendStreamTableSink, RetractStreamTableSink, or
>> UpsertStreamTableSink.
>
>
>
>--
>
>Benchao Li
>School of Electronics Engineering and Computer Science, Peking University
>Tel:+86-15650713730
>Email: [hidden email]; [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Re: insert overwrite 问题

Jark
Administrator
Hi 明文,

目前 HiveTableSink 不支持流式写入(未实现 AppendStreamTableSink)。你可以将执行模式改成 batch
模式,就可以运行了。

SET execution.type=batch;


Best,
Jark

On Sun, 16 Feb 2020 at 15:36, 潘明文 <[hidden email]> wrote:

>
>
>    HI ,
>     HiveTableSink正对HIVE 种创建的表可以是吗? 但我用HIVE 创建表的(表是在HIVE 中创建的),FLINK SQL
> 中直接使用HIVE 表
> Flink SQL> INSERT INTO hive_test select '11';
> [INFO] Submitting SQL update statement to the cluster...
> [ERROR] Could not execute SQL statement. Reason:
> org.apache.flink.table.api.TableException: Stream Tables can only be
> emitted by AppendStreamTableSink, RetractStreamTableSink, or
> UpsertStreamTableSink.
> Flink SQL> INSERT overwrite  hive_test select '11';
> [INFO] Submitting SQL update statement to the cluster...
> [ERROR] Could not execute SQL statement. Reason:
> org.apache.flink.table.api.TableException: Stream Tables can only be
> emitted by AppendStreamTableSink, RetractStreamTableSink, or
> UpsertStreamTableSink.
>
>
>
>
>
>
>
>
> 在 2020-02-16 09:27:29,"Benchao Li" <[hidden email]> 写道:
> >Hi 明文,
> >
> >现在insert overwrite应该是只支持HiveTableSink。所以如果你不是HiveTableSink的话,可以直接用“insert
> >into ..."就可以了。
> >
> >潘明文 <[hidden email]> 于2020年2月16日周日 上午8:38写道:
> >
> >> 您好,
> >>     sql 出现以下错误,是什么原因造成的呀?
> >>
> >>
> >>     Flink SQL> insert overwrite pmw select '1';
> >> [INFO] Submitting SQL update statement to the cluster...
> >> [ERROR] Could not execute SQL statement. Reason:
> >> org.apache.flink.table.api.TableException: Stream Tables can only be
> >> emitted by AppendStreamTableSink, RetractStreamTableSink, or
> >> UpsertStreamTableSink.
> >
> >
> >
> >--
> >
> >Benchao Li
> >School of Electronics Engineering and Computer Science, Peking University
> >Tel:+86-15650713730
> >Email: [hidden email]; [hidden email]
>