You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by 大森林 <ap...@foxmail.com> on 2020/10/20 13:56:09 UTC

rename error in flink sql

I'm learning "select"from
official document





my code is:
https://paste.ubuntu.com/p/yVYhZqMNq7/


the error I got is:
&nbsp;total is not found in PojoType<Order, fields = [amount: Integer, product: String, user: Long]&gt;


It's strange that the rename name should be found in pojo.


Could anyone help me?
thanks for your help

Re: 回复: rename error in flink sql

Posted by Timo Walther <tw...@apache.org>.
Hi,

sorry for the late reply. I the problem was in the 
`tEnv.toAppendStream(result,Order.class).print();` right?

You can also find a new example here:

https://github.com/apache/flink/blob/master/flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/basics/GettingStartedExample.java

We are in the process of adding more example code for beginners.

I will reply to your JIRA issue in the comments.

Regards,
Timo


On 21.10.20 07:17, 大森林 wrote:
> Thanks for your help,I have finally modify it and solve it by luck.
> 
> but new relevent question occur:
> https://issues.apache.org/jira/browse/FLINK-19746
> Could you please have a look at it?
> 
> *I know JIRA is for bug only,but the email will destroy the table I posted,*
> *forgive me for posting in JIRA and close it if you think it's not a bug.*
> 
> Thanks for your help
> 
> 
> ------------------ 原始邮件 ------------------
> *发件人:* "大森林" <ap...@foxmail.com>;
> *发送时间:* 2020年10月21日(星期三) 上午10:54
> *收件人:* "Andrey Zagrebin"<az...@apache.org>;
> *抄送:* "user"<us...@flink.apache.org>;"dwysakowicz" 
> <dw...@apache.org>;
> *主题:* 回复: rename error in flink sql
> 
> 
> Thanks for your replies.
> 
> um....
> Could you tell me *where I am wrong in this code?*
> *I'm weak in Java.*
> *
> *
> The pojo is copied from flink official example:
> https://paste.ubuntu.com/p/kRKxwBpSVK/
> 
> the test code is:
> https://paste.ubuntu.com/p/yVYhZqMNq7/
> 
> Thanks for your help~!
> 
> 
> ------------------ 原始邮件 ------------------
> *发件人:* "Andrey Zagrebin" <az...@apache.org>;
> *发送时间:* 2020年10月20日(星期二) 晚上11:58
> *收件人:* "大森林"<ap...@foxmail.com>;
> *抄送:* "user"<us...@flink.apache.org>;"dwysakowicz" 
> <dw...@apache.org>;
> *主题:* Re: rename error in flink sql
> 
> Hi,
> 
> I am not an SQL expert but I would not expect the original POJO to match 
> the new row with the renamed field.
> Maybe Timo or Dawid have to add something.
> 
> Best,
> Andrey
> 
> On Tue, Oct 20, 2020 at 4:56 PM 大森林 <appleyuchi@foxmail.com 
> <ma...@foxmail.com>> wrote:
> 
> 
>     I'm learning "select"from
>     official document
>     <https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/tableApi.html>
> 
> 
>     my code is:
>     https://paste.ubuntu.com/p/yVYhZqMNq7/
> 
>     the error I got is:
>       total is not found in PojoType<Order, fields = [amount: Integer,
>     product: String, user: Long]>
> 
>     It's strange that the*renamed field should be found in pojo.*
>     *
>     *
>     *Could anyone help me?*
>     *thanks for your help*
> 
> 
> 


回复: rename error in flink sql

Posted by 大森林 <ap...@foxmail.com>.
Thanks for your help,I have finally modify it and solve it by luck.


but new relevent question occur:
https://issues.apache.org/jira/browse/FLINK-19746
Could you please have a look at it?


I know JIRA is for bug only,but the email will destroy the table I posted,
forgive me for posting in JIRA and close it if you think it's not a bug.


Thanks for your help




------------------&nbsp;原始邮件&nbsp;------------------
发件人:                                                                                                                        "大森林"                                                                                    <appleyuchi@foxmail.com&gt;;
发送时间:&nbsp;2020年10月21日(星期三) 上午10:54
收件人:&nbsp;"Andrey Zagrebin"<azagrebin@apache.org&gt;;
抄送:&nbsp;"user"<user@flink.apache.org&gt;;"dwysakowicz"<dwysakowicz@apache.org&gt;;"twalthr"<twalthr@apache.org&gt;;
主题:&nbsp;回复: rename error in flink sql




Thanks for your replies.


um....
Could you tell me where I am wrong in this code?
I'm weak in Java.


The pojo is copied from flink official example:
https://paste.ubuntu.com/p/kRKxwBpSVK/


the test code is:
https://paste.ubuntu.com/p/yVYhZqMNq7/



Thanks for your help~!




------------------ 原始邮件 ------------------
发件人:                                                                                                                        "Andrey Zagrebin"                                                                                    <azagrebin@apache.org&gt;;
发送时间:&nbsp;2020年10月20日(星期二) 晚上11:58
收件人:&nbsp;"大森林"<appleyuchi@foxmail.com&gt;;
抄送:&nbsp;"user"<user@flink.apache.org&gt;;"dwysakowicz"<dwysakowicz@apache.org&gt;;"twalthr"<twalthr@apache.org&gt;;
主题:&nbsp;Re: rename error in flink sql



Hi,

I am not an SQL expert but I would not expect the original POJO to match the new row with the renamed field.
Maybe Timo or Dawid have to add something.


Best,
Andrey


On Tue, Oct 20, 2020 at 4:56 PM 大森林 <appleyuchi@foxmail.com&gt; wrote:



I'm learning "select"from
official document





my code is:
https://paste.ubuntu.com/p/yVYhZqMNq7/


the error I got is:
&nbsp;total is not found in PojoType<Order, fields = [amount: Integer, product: String, user: Long]&gt;


It's strange that the renamed field should be found in pojo.


Could anyone help me?
thanks for your help

回复: rename error in flink sql

Posted by 大森林 <ap...@foxmail.com>.
Thanks for your replies.


um....
Could you tell me where I am wrong in this code?
I'm weak in Java.


The pojo is copied from flink official example:
https://paste.ubuntu.com/p/kRKxwBpSVK/


the test code is:
https://paste.ubuntu.com/p/yVYhZqMNq7/



Thanks for your help~!




------------------&nbsp;原始邮件&nbsp;------------------
发件人:                                                                                                                        "Andrey Zagrebin"                                                                                    <azagrebin@apache.org&gt;;
发送时间:&nbsp;2020年10月20日(星期二) 晚上11:58
收件人:&nbsp;"大森林"<appleyuchi@foxmail.com&gt;;
抄送:&nbsp;"user"<user@flink.apache.org&gt;;"dwysakowicz"<dwysakowicz@apache.org&gt;;"twalthr"<twalthr@apache.org&gt;;
主题:&nbsp;Re: rename error in flink sql



Hi,

I am not an SQL expert but I would not expect&nbsp;the original POJO to match the new row with the renamed field.
Maybe Timo or Dawid have to add something.


Best,
Andrey


On Tue, Oct 20, 2020 at 4:56 PM 大森林 <appleyuchi@foxmail.com&gt; wrote:



I'm learning "select"from
official document





my code is:
https://paste.ubuntu.com/p/yVYhZqMNq7/


the error I got is:
&nbsp;total is not found in PojoType<Order, fields = [amount: Integer, product: String, user: Long]&gt;


It's strange that the renamed field should be found in pojo.


Could anyone help me?
thanks for your help

Re: rename error in flink sql

Posted by Andrey Zagrebin <az...@apache.org>.
Hi,

I am not an SQL expert but I would not expect the original POJO to match
the new row with the renamed field.
Maybe Timo or Dawid have to add something.

Best,
Andrey

On Tue, Oct 20, 2020 at 4:56 PM 大森林 <ap...@foxmail.com> wrote:

>
> I'm learning "select"from
> official document
> <https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/tableApi.html>
>
>
> my code is:
> https://paste.ubuntu.com/p/yVYhZqMNq7/
>
> the error I got is:
>  total is not found in PojoType<Order, fields = [amount: Integer, product:
> String, user: Long]>
>
> It's strange that the* rename name should be found in pojo.*
>
> *Could anyone help me?*
> *thanks for your help*
>
>
>
>