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 Jeff <zi...@126.com> on 2023/03/22 02:28:17 UTC

我上报的一个sql bug没人处理怎么办?

bug地址:
https://issues.apache.org/jira/browse/FLINK-31375?filter=-2


bug详细内容:
the values of map<string,string> are truncated by the CASE WHEN function.
// sql
create table test (a map<varchar, string>) with ('connector'='print');
insert into test  select * from (values(case when true then map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc'] end));

the result:

+I[{test=123}] 

We hope the value of result is '123456789', but I get '123', the length is limited by 'abc'.

Re:Re: Re: 我上报的一个sql bug没人处理怎么办?

Posted by Jeff <zi...@126.com>.
这个方法有效,多谢

















在 2023-03-22 17:11:19,"Jane Chan" <qi...@gmail.com> 写道:
>Hi,
>
>如回复所述, 如果不想切换版本, 在 1.15 上可以尝试手动 cast 'abc' 字段为 varchar 来绕过这个问题
>map ['msg_code','0', 'msg_reason', cast('abc' as string)]
>
>如果不想修改 SQL, 目前只能手动编译出 release-1.17 分支, 编译方法参考 [1]
>
>[1]
>https://nightlies.apache.org/flink/flink-docs-master/docs/flinkdev/building/
>
>祝好!
>Jane
>
>On Wed, Mar 22, 2023 at 6:04 PM Jeff <zi...@126.com> wrote:
>
>> 通过读calcite1.27.0相关源码发现它已经修复了,但我使用的是flink 1.15无法直接使用1.27.0,所以只能使用本地编译的版本么?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 在 2023-03-22 10:41:42,"Shuo Cheng" <nj...@gmail.com> 写道:
>> >Hi,
>> >
>> >如果你知道问题出现在哪儿, 可以自己提个 PR 哦.
>> >
>> >Sincerely,
>> >Shuo
>> >
>> >On Wed, Mar 22, 2023 at 11:23 AM Jeff <zi...@126.com> wrote:
>> >
>> >> 复制执行我提供的两个sql就一定会复现!
>> >> 不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
>> >> 这个问题是这个版本calcite引起的。
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> 在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
>> >> >bug地址:
>> >> >https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
>> >> >
>> >> >
>> >> >bug详细内容:
>> >> >the values of map<string,string> are truncated by the CASE WHEN
>> function.
>> >> >// sql
>> >> >create table test (a map<varchar, string>) with ('connector'='print');
>> >> >insert into test  select * from (values(case when true then
>> >> map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
>> >> end));
>> >> >
>> >> >the result:
>> >> >
>> >> >+I[{test=123}]
>> >> >
>> >> >We hope the value of result is '123456789', but I get '123', the length
>> >> is limited by 'abc'.
>> >>
>>

Re:Re: Re: 我上报的一个sql bug没人处理怎么办?

Posted by Jeff <zi...@126.com>.
试过了,不兼容,1.27.0都不兼容

















在 2023-03-22 18:04:17,"tison" <wa...@gmail.com> 写道:
>如果 calcite 层的接口不变,直接替换 jar 包或许也可行?不确定从 1.27 -> 1.29 有没有不兼容的情况。
>
>Best,
>tison.
>
>
>Jane Chan <qi...@gmail.com> 于2023年3月22日周三 18:11写道:
>
>> Hi,
>>
>> 如回复所述, 如果不想切换版本, 在 1.15 上可以尝试手动 cast 'abc' 字段为 varchar 来绕过这个问题
>> map ['msg_code','0', 'msg_reason', cast('abc' as string)]
>>
>> 如果不想修改 SQL, 目前只能手动编译出 release-1.17 分支, 编译方法参考 [1]
>>
>> [1]
>>
>> https://nightlies.apache.org/flink/flink-docs-master/docs/flinkdev/building/
>>
>> 祝好!
>> Jane
>>
>> On Wed, Mar 22, 2023 at 6:04 PM Jeff <zi...@126.com> wrote:
>>
>> > 通过读calcite1.27.0相关源码发现它已经修复了,但我使用的是flink 1.15无法直接使用1.27.0,所以只能使用本地编译的版本么?
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > 在 2023-03-22 10:41:42,"Shuo Cheng" <nj...@gmail.com> 写道:
>> > >Hi,
>> > >
>> > >如果你知道问题出现在哪儿, 可以自己提个 PR 哦.
>> > >
>> > >Sincerely,
>> > >Shuo
>> > >
>> > >On Wed, Mar 22, 2023 at 11:23 AM Jeff <zi...@126.com> wrote:
>> > >
>> > >> 复制执行我提供的两个sql就一定会复现!
>> > >> 不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
>> > >> 这个问题是这个版本calcite引起的。
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >> 在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
>> > >> >bug地址:
>> > >> >https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
>> > >> >
>> > >> >
>> > >> >bug详细内容:
>> > >> >the values of map<string,string> are truncated by the CASE WHEN
>> > function.
>> > >> >// sql
>> > >> >create table test (a map<varchar, string>) with
>> ('connector'='print');
>> > >> >insert into test  select * from (values(case when true then
>> > >> map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
>> > >> end));
>> > >> >
>> > >> >the result:
>> > >> >
>> > >> >+I[{test=123}]
>> > >> >
>> > >> >We hope the value of result is '123456789', but I get '123', the
>> length
>> > >> is limited by 'abc'.
>> > >>
>> >
>>

Re: Re: 我上报的一个sql bug没人处理怎么办?

Posted by tison <wa...@gmail.com>.
如果 calcite 层的接口不变,直接替换 jar 包或许也可行?不确定从 1.27 -> 1.29 有没有不兼容的情况。

Best,
tison.


Jane Chan <qi...@gmail.com> 于2023年3月22日周三 18:11写道:

> Hi,
>
> 如回复所述, 如果不想切换版本, 在 1.15 上可以尝试手动 cast 'abc' 字段为 varchar 来绕过这个问题
> map ['msg_code','0', 'msg_reason', cast('abc' as string)]
>
> 如果不想修改 SQL, 目前只能手动编译出 release-1.17 分支, 编译方法参考 [1]
>
> [1]
>
> https://nightlies.apache.org/flink/flink-docs-master/docs/flinkdev/building/
>
> 祝好!
> Jane
>
> On Wed, Mar 22, 2023 at 6:04 PM Jeff <zi...@126.com> wrote:
>
> > 通过读calcite1.27.0相关源码发现它已经修复了,但我使用的是flink 1.15无法直接使用1.27.0,所以只能使用本地编译的版本么?
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 在 2023-03-22 10:41:42,"Shuo Cheng" <nj...@gmail.com> 写道:
> > >Hi,
> > >
> > >如果你知道问题出现在哪儿, 可以自己提个 PR 哦.
> > >
> > >Sincerely,
> > >Shuo
> > >
> > >On Wed, Mar 22, 2023 at 11:23 AM Jeff <zi...@126.com> wrote:
> > >
> > >> 复制执行我提供的两个sql就一定会复现!
> > >> 不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
> > >> 这个问题是这个版本calcite引起的。
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> 在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
> > >> >bug地址:
> > >> >https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
> > >> >
> > >> >
> > >> >bug详细内容:
> > >> >the values of map<string,string> are truncated by the CASE WHEN
> > function.
> > >> >// sql
> > >> >create table test (a map<varchar, string>) with
> ('connector'='print');
> > >> >insert into test  select * from (values(case when true then
> > >> map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
> > >> end));
> > >> >
> > >> >the result:
> > >> >
> > >> >+I[{test=123}]
> > >> >
> > >> >We hope the value of result is '123456789', but I get '123', the
> length
> > >> is limited by 'abc'.
> > >>
> >
>

Re: Re: 我上报的一个sql bug没人处理怎么办?

Posted by Jane Chan <qi...@gmail.com>.
Hi,

如回复所述, 如果不想切换版本, 在 1.15 上可以尝试手动 cast 'abc' 字段为 varchar 来绕过这个问题
map ['msg_code','0', 'msg_reason', cast('abc' as string)]

如果不想修改 SQL, 目前只能手动编译出 release-1.17 分支, 编译方法参考 [1]

[1]
https://nightlies.apache.org/flink/flink-docs-master/docs/flinkdev/building/

祝好!
Jane

On Wed, Mar 22, 2023 at 6:04 PM Jeff <zi...@126.com> wrote:

> 通过读calcite1.27.0相关源码发现它已经修复了,但我使用的是flink 1.15无法直接使用1.27.0,所以只能使用本地编译的版本么?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 在 2023-03-22 10:41:42,"Shuo Cheng" <nj...@gmail.com> 写道:
> >Hi,
> >
> >如果你知道问题出现在哪儿, 可以自己提个 PR 哦.
> >
> >Sincerely,
> >Shuo
> >
> >On Wed, Mar 22, 2023 at 11:23 AM Jeff <zi...@126.com> wrote:
> >
> >> 复制执行我提供的两个sql就一定会复现!
> >> 不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
> >> 这个问题是这个版本calcite引起的。
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> 在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
> >> >bug地址:
> >> >https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
> >> >
> >> >
> >> >bug详细内容:
> >> >the values of map<string,string> are truncated by the CASE WHEN
> function.
> >> >// sql
> >> >create table test (a map<varchar, string>) with ('connector'='print');
> >> >insert into test  select * from (values(case when true then
> >> map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
> >> end));
> >> >
> >> >the result:
> >> >
> >> >+I[{test=123}]
> >> >
> >> >We hope the value of result is '123456789', but I get '123', the length
> >> is limited by 'abc'.
> >>
>

Re:Re: 我上报的一个sql bug没人处理怎么办?

Posted by Jeff <zi...@126.com>.
通过读calcite1.27.0相关源码发现它已经修复了,但我使用的是flink 1.15无法直接使用1.27.0,所以只能使用本地编译的版本么?



















在 2023-03-22 10:41:42,"Shuo Cheng" <nj...@gmail.com> 写道:
>Hi,
>
>如果你知道问题出现在哪儿, 可以自己提个 PR 哦.
>
>Sincerely,
>Shuo
>
>On Wed, Mar 22, 2023 at 11:23 AM Jeff <zi...@126.com> wrote:
>
>> 复制执行我提供的两个sql就一定会复现!
>> 不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
>> 这个问题是这个版本calcite引起的。
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
>> >bug地址:
>> >https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
>> >
>> >
>> >bug详细内容:
>> >the values of map<string,string> are truncated by the CASE WHEN function.
>> >// sql
>> >create table test (a map<varchar, string>) with ('connector'='print');
>> >insert into test  select * from (values(case when true then
>> map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
>> end));
>> >
>> >the result:
>> >
>> >+I[{test=123}]
>> >
>> >We hope the value of result is '123456789', but I get '123', the length
>> is limited by 'abc'.
>>

Re: 我上报的一个sql bug没人处理怎么办?

Posted by Jane Chan <qi...@gmail.com>.
Hi,

这是 Calcite 的一个 bug[1], 已经在 1.27.0 上修复. 不过由于 Flink 1.15.1, 1.15.2 和 1.16.1
都依赖 Calcite 1.26.0, 所以目前只能尝试如下方式绕过, 可以等 release-1.17 发布后升级到新版本上, 应该不会再有问题了.

select * from (values(case when true then map['test','123456789'] else
map ['msg_code','0', 'msg_reason', cast('abc' as string)] end));


[1] https://issues.apache.org/jira/browse/CALCITE-4603

Best,
Jane

On Wed, Mar 22, 2023 at 11:49 AM tison <wa...@gmail.com> wrote:

> 你可以关注下发布动态,测试一下 RC
> https://lists.apache.org/thread/d9o0tgnv0fl9goqsdo8wmq9121b9wolv
>
> Best,
> tison.
>
>
> tison <wa...@gmail.com> 于2023年3月22日周三 11:47写道:
>
> > Flink master 上 calcite 的版本是 1.29,看起来会在 Flink 1.17 release 出来
> >
> > Best,
> > tison.
> >
> >
> > Shuo Cheng <nj...@gmail.com> 于2023年3月22日周三 11:42写道:
> >
> >> Hi,
> >>
> >> 如果你知道问题出现在哪儿, 可以自己提个 PR 哦.
> >>
> >> Sincerely,
> >> Shuo
> >>
> >> On Wed, Mar 22, 2023 at 11:23 AM Jeff <zi...@126.com> wrote:
> >>
> >> > 复制执行我提供的两个sql就一定会复现!
> >> > 不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
> >> > 这个问题是这个版本calcite引起的。
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > 在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
> >> > >bug地址:
> >> > >https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
> >> > >
> >> > >
> >> > >bug详细内容:
> >> > >the values of map<string,string> are truncated by the CASE WHEN
> >> function.
> >> > >// sql
> >> > >create table test (a map<varchar, string>) with
> ('connector'='print');
> >> > >insert into test  select * from (values(case when true then
> >> > map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
> >> > end));
> >> > >
> >> > >the result:
> >> > >
> >> > >+I[{test=123}]
> >> > >
> >> > >We hope the value of result is '123456789', but I get '123', the
> length
> >> > is limited by 'abc'.
> >> >
> >>
> >
>

Re: 我上报的一个sql bug没人处理怎么办?

Posted by tison <wa...@gmail.com>.
你可以关注下发布动态,测试一下 RC
https://lists.apache.org/thread/d9o0tgnv0fl9goqsdo8wmq9121b9wolv

Best,
tison.


tison <wa...@gmail.com> 于2023年3月22日周三 11:47写道:

> Flink master 上 calcite 的版本是 1.29,看起来会在 Flink 1.17 release 出来
>
> Best,
> tison.
>
>
> Shuo Cheng <nj...@gmail.com> 于2023年3月22日周三 11:42写道:
>
>> Hi,
>>
>> 如果你知道问题出现在哪儿, 可以自己提个 PR 哦.
>>
>> Sincerely,
>> Shuo
>>
>> On Wed, Mar 22, 2023 at 11:23 AM Jeff <zi...@126.com> wrote:
>>
>> > 复制执行我提供的两个sql就一定会复现!
>> > 不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
>> > 这个问题是这个版本calcite引起的。
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > 在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
>> > >bug地址:
>> > >https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
>> > >
>> > >
>> > >bug详细内容:
>> > >the values of map<string,string> are truncated by the CASE WHEN
>> function.
>> > >// sql
>> > >create table test (a map<varchar, string>) with ('connector'='print');
>> > >insert into test  select * from (values(case when true then
>> > map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
>> > end));
>> > >
>> > >the result:
>> > >
>> > >+I[{test=123}]
>> > >
>> > >We hope the value of result is '123456789', but I get '123', the length
>> > is limited by 'abc'.
>> >
>>
>

Re: 我上报的一个sql bug没人处理怎么办?

Posted by tison <wa...@gmail.com>.
Flink master 上 calcite 的版本是 1.29,看起来会在 Flink 1.17 release 出来

Best,
tison.


Shuo Cheng <nj...@gmail.com> 于2023年3月22日周三 11:42写道:

> Hi,
>
> 如果你知道问题出现在哪儿, 可以自己提个 PR 哦.
>
> Sincerely,
> Shuo
>
> On Wed, Mar 22, 2023 at 11:23 AM Jeff <zi...@126.com> wrote:
>
> > 复制执行我提供的两个sql就一定会复现!
> > 不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
> > 这个问题是这个版本calcite引起的。
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
> > >bug地址:
> > >https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
> > >
> > >
> > >bug详细内容:
> > >the values of map<string,string> are truncated by the CASE WHEN
> function.
> > >// sql
> > >create table test (a map<varchar, string>) with ('connector'='print');
> > >insert into test  select * from (values(case when true then
> > map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
> > end));
> > >
> > >the result:
> > >
> > >+I[{test=123}]
> > >
> > >We hope the value of result is '123456789', but I get '123', the length
> > is limited by 'abc'.
> >
>

Re: 我上报的一个sql bug没人处理怎么办?

Posted by Shuo Cheng <nj...@gmail.com>.
Hi,

如果你知道问题出现在哪儿, 可以自己提个 PR 哦.

Sincerely,
Shuo

On Wed, Mar 22, 2023 at 11:23 AM Jeff <zi...@126.com> wrote:

> 复制执行我提供的两个sql就一定会复现!
> 不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
> 这个问题是这个版本calcite引起的。
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
> >bug地址:
> >https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
> >
> >
> >bug详细内容:
> >the values of map<string,string> are truncated by the CASE WHEN function.
> >// sql
> >create table test (a map<varchar, string>) with ('connector'='print');
> >insert into test  select * from (values(case when true then
> map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
> end));
> >
> >the result:
> >
> >+I[{test=123}]
> >
> >We hope the value of result is '123456789', but I get '123', the length
> is limited by 'abc'.
>

Re:我上报的一个sql bug没人处理怎么办?

Posted by Jeff <zi...@126.com>.
复制执行我提供的两个sql就一定会复现!
不管哪个flink版本一定都会有这个问题,因为它们都是使用calcite 1.26.0。
这个问题是这个版本calcite引起的。

















在 2023-03-22 09:28:17,"Jeff" <zi...@126.com> 写道:
>bug地址:
>https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
>
>
>bug详细内容:
>the values of map<string,string> are truncated by the CASE WHEN function.
>// sql
>create table test (a map<varchar, string>) with ('connector'='print');
>insert into test  select * from (values(case when true then map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc'] end));
>
>the result:
>
>+I[{test=123}] 
>
>We hope the value of result is '123456789', but I get '123', the length is limited by 'abc'.

Re: 我上报的一个sql bug没人处理怎么办?

Posted by Weihua Hu <hu...@gmail.com>.
Hi

我使用同样的 SQL 没有复现该问题,你可以提供下复现的办法吗?

Best,
Weihua


On Wed, Mar 22, 2023 at 10:28 AM Jeff <zi...@126.com> wrote:

> bug地址:
> https://issues.apache.org/jira/browse/FLINK-31375?filter=-2
>
>
> bug详细内容:
> the values of map<string,string> are truncated by the CASE WHEN function.
> // sql
> create table test (a map<varchar, string>) with ('connector'='print');
> insert into test  select * from (values(case when true then
> map['test','123456789'] else map ['msg_code','0', 'msg_reason', 'abc']
> end));
>
> the result:
>
> +I[{test=123}]
>
> We hope the value of result is '123456789', but I get '123', the length is
> limited by 'abc'.