You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by 潘明文 <pa...@163.com> on 2020/02/16 00:38:35 UTC

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.

Re: insert overwrite 问题

Posted by Jark Wu <im...@gmail.com>.
Hi 明文,

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


Best,
Jark




On Sun, 16 Feb 2020 at 09:27, Benchao Li <li...@gmail.com> wrote:

> Hi 明文,
>
> 现在insert overwrite应该是只支持HiveTableSink。所以如果你不是HiveTableSink的话,可以直接用“insert
> into ..."就可以了。
>
> 潘明文 <pa...@163.com> 于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: libenchao@gmail.com; libenchao@pku.edu.cn
>

Re: Re: insert overwrite 问题

Posted by Jark Wu <im...@gmail.com>.
Hi 明文,

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

SET execution.type=batch;


Best,
Jark

On Sun, 16 Feb 2020 at 15:36, 潘明文 <pa...@163.com> 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" <li...@gmail.com> 写道:
> >Hi 明文,
> >
> >现在insert overwrite应该是只支持HiveTableSink。所以如果你不是HiveTableSink的话,可以直接用“insert
> >into ..."就可以了。
> >
> >潘明文 <pa...@163.com> 于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: libenchao@gmail.com; libenchao@pku.edu.cn
>

Re:Re: insert overwrite 问题

Posted by 潘明文 <pa...@163.com>.

   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" <li...@gmail.com> 写道:
>Hi 明文,
>
>现在insert overwrite应该是只支持HiveTableSink。所以如果你不是HiveTableSink的话,可以直接用“insert
>into ..."就可以了。
>
>潘明文 <pa...@163.com> 于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: libenchao@gmail.com; libenchao@pku.edu.cn

Re: insert overwrite 问题

Posted by Benchao Li <li...@gmail.com>.
Hi 明文,

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

潘明文 <pa...@163.com> 于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: libenchao@gmail.com; libenchao@pku.edu.cn