Skip to content

fix(isthmus): fix argument order for trim function mapping#714

Open
nielspardon wants to merge 1 commit intosubstrait-io:mainfrom
nielspardon:par-trim
Open

fix(isthmus): fix argument order for trim function mapping#714
nielspardon wants to merge 1 commit intosubstrait-io:mainfrom
nielspardon:par-trim

Conversation

@nielspardon
Copy link
Member

The Calcite/SQL trim function has the following syntax:

TRIM(BOTH characters FROM input)
TRIM(LEADING characters FROM input)
TRIM(TRAILING characters FROM input)

https://calcite.apache.org/docs/reference.html#character-string-operators-and-functions

While the Substrait trim, ltrim, rtrim functions are defined as:

trim(input, characters)
ltrim(input, characters)
rtrim(input, characters)

https://github.com/substrait-io/substrait/blob/ee109ad48f149f2e3706d51b597febe86b79b225/extensions/functions_string.yaml#L1299-L1363

This PR fixes the argument order for the trim function mapping in isthmus by swapping the input and characters arguments during conversion.

Signed-off-by: Niels Pardon <par@zurich.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant