You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Yu Xu (Jira)" <ji...@apache.org> on 2026/10/07 02:46:00 UTC
[jira] [Assigned] (CALCITE-6068) Whitespaces are removed from filter values
[ https://issues.apache.org/jira/browse/CALCITE-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yu Xu reassigned CALCITE-6068:
------------------------------
Assignee: Yu Xu
> 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
>
> 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)