[
https://issues.apache.org/jira/browse/FLINK-22448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jark Wu updated FLINK-22448:
----------------------------
Component/s: Table SQL / Planner
> FlinkRexUtil create Sarg String array elemet supplement space
> -------------------------------------------------------------
>
> Key: FLINK-22448
> URL: https://issues.apache.org/jira/browse/FLINK-22448
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Reporter: Junning Liang
> Priority: Major
> Fix For: 1.13.0
>
>
> As we know, the new version of Calcite introduces the {{SEARCH}} rex call to
> express range conditions. But when i used string array to express range in
> the StreamSQL, i found that some string in the array had problems with the
> completion length by using space.
> the following query:
>
> {code:java}
> create view tempView as
> select * from sourceTable where action in ('systemnotifyv2',
> 'session_auth', 'create_session', 'close_single_chat'){code}
> after Sarg operator created, the result is :
>
>
> {code:java}
> create view tempView as
> select * from sourceTable where action in ('systemnotifyv2', 'session_auth
> ', 'create_session', 'close_single_chat')
> {code}
> I debuged to see why dose the happans. After calling rexBuilder.makeLiteral
> in
> FlinkRexUtil#expandSearchOperands, the string 'session_auth' became
> 'session_auth '.And i also found that the type and length of the string
> array were determined by the first string in the array.Just like my example
> above, the type of the array was Char and the length of the array was 14.the
> length of 'session_auth' string was 12 so that calcite would supplement 2
> space to make it meet the length of 14.
> Now, i All I can think of is adding trim parameter to remove the space。do you
> have a better way to fix or avoid the problem happens?
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)