[
https://issues.apache.org/jira/browse/CALCITE-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yu Xu resolved CALCITE-6068.
----------------------------
Fix Version/s: 1.43.0
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/b37906810abf1206755242d420ccc6bfa0d3dee8]
Thank you reported this Jira [~pmsgd]
Thank you for the review [~mbudiu]
> Whitespaces are removed from filter values
> ------------------------------------------
>
> Key: CALCITE-6068
> URL: https://issues.apache.org/jira/browse/CALCITE-6068
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.35.0
> Reporter: Petr Masopust
> Assignee: Yu Xu
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.43.0
>
>
> SqlImplementor.java has hardcoded "true" for trimming whitespaces in
> Context.toIn method
> ([https://github.com/apache/calcite/blob/c83ac69111fd9e75af5e3615af29a72284667a4a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java#L908]).
>
> This makes troubles for our customer who use values like "Value 1 " etc.
> (don't ask me why).
> E.g.
> val filter = relBuilder.`in`(
> opportunityId,
> relBuilder.literal("value 1 "),
> relBuilder.literal("value 2 ")
> )
> is translated to "id" IN ('value 1', 'value 2') WITHOUT spaces at the end.
>
> I don't know why is such trimming implemented but calcite should not touch
> user inputs. Please make this at least configurable because I don't know any
> workaround. Obvious one with OR and equalities is optimized to IN and trimmed
> too.
> Test reproducer is in [https://github.com/pmsgd/calcite5888] repo in AppTest
> as testCalcite6068.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)