Github user twalthr commented on a diff in the pull request:
https://github.com/apache/flink/pull/1747#discussion_r54601133
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/codegen/calls/ScalarFunctions.scala
---
@@ -49,6 +49,11 @@ object ScalarFunctions {
STRING_TYPE_INFO,
BuiltInMethod.SUBSTRING.method)
+ addSqlFunctionTrim(
--- End diff --
`TRIM` is a special case because the runtime function takes other
parameters than the user can provide. In SQL `TRIM` has its own syntax
`TRIM(BOTH '.' FROM str)`. `BOTH` is translated into a SQL Symbol but the
runtime function uses two boolean arguments. That's why we cannot pass the
arguments directly to runtime function and need a special `TrimCallGenerator`.
The SQL Symbol is translated to an integer value (the same same value can also
come from Expression API) and is then translated to the two `boolean`
parameters.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---