You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Ayush Chauhan <ay...@zomato.com> on 2021/11/30 04:14:51 UTC
Flink-13 table API wrongly adding padding for IN clause elements
Hi,
In Flink 13, while using filter/where condition in table api I am getting
wrong results. Upon debugging I found that it is adding padding to the IN
clause elements according to the first element in the IN clause.
Here's the sample code
tEnv.toAppendStream(input.where($("ename").in("O2CartPageLoaded","OrderPlaced","O2MenuViewed","opened_app"))
.select($("ename")), Utils.getTypeInfo("ename:string")).print();
Screenshot of hashset
[image: Screenshot 2021-11-29 at 16.24.59.png]
If I change the IN clasue element order, then the padding also changes
tEnv.toAppendStream(input.where($("ename").in("OrderPlaced","O2CartPageLoaded","O2MenuViewed","opened_app"))
.select($("ename")), Utils.getTypeInfo("ename:string")).print();
Screenshot of hashset
[image: Screenshot 2021-11-29 at 16.23.20.png]
--
Ayush Chauhan
Data Platform
--
This email is intended only for the person or the entity to
whom it is addressed. If you are not the intended recipient, please delete
this email and contact the sender.
Re: Flink-13 table API wrongly adding padding for IN clause elements
Posted by Caizhi Weng <ts...@gmail.com>.
Hi!
Thanks for raising this issue which is a known issue [1]. Currently, I
would recommend creating a UDF as a workaround.
[1] https://issues.apache.org/jira/browse/FLINK-24708
Ayush Chauhan <ay...@zomato.com> 于2021年11月30日周二 下午12:15写道:
> Hi,
>
> In Flink 13, while using filter/where condition in table api I am getting
> wrong results. Upon debugging I found that it is adding padding to the IN
> clause elements according to the first element in the IN clause.
>
> Here's the sample code
>
> tEnv.toAppendStream(input.where($("ename").in("O2CartPageLoaded","OrderPlaced","O2MenuViewed","opened_app"))
> .select($("ename")), Utils.getTypeInfo("ename:string")).print();
>
> Screenshot of hashset
> [image: Screenshot 2021-11-29 at 16.24.59.png]
>
> If I change the IN clasue element order, then the padding also changes
>
> tEnv.toAppendStream(input.where($("ename").in("OrderPlaced","O2CartPageLoaded","O2MenuViewed","opened_app"))
> .select($("ename")), Utils.getTypeInfo("ename:string")).print();
>
> Screenshot of hashset
> [image: Screenshot 2021-11-29 at 16.23.20.png]
>
> --
> Ayush Chauhan
> Data Platform
>
>
>
>
> This email is intended only for the person or the entity to whom it is
> addressed. If you are not the intended recipient, please delete this email
> and contact the sender.
>