Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
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:
create view tempView as select * from sourceTable where action in ('systemnotifyv2', 'session_auth', 'create_session', 'close_single_chat')
after Sarg operator created, the result is :
create view tempView as select * from sourceTable where action in ('systemnotifyv2', 'session_auth ', 'create_session', 'close_single_chat')
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?
Attachments
Issue Links
- is duplicated by
-
FLINK-22486 Wrong results of the IN operator
- Closed