kasakrisz commented on a change in pull request #1810:
URL: https://github.com/apache/hive/pull/1810#discussion_r551958137



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseTrim.java
##########
@@ -68,11 +82,24 @@ public Object evaluate(DeferredObject[] arguments) throws 
HiveException {
     if (valObject == null) {
       return null;
     }
-    String val = ((Text) converter.convert(valObject)).toString();
+    String val = stringToTrimConverter.convert(valObject).toString();
     if (val == null) {
       return null;
     }
-    result.set(performOp(val.toString()));
+
+    String trimChars = " ";

Review comment:
       I add supporting vectorized two parameter version of trim functions when 
the first parameter is a column the second is a literal. Example: 
   ```
   create table t1 (col0 string);
   select trim(col0, 'xy') from t1 group by col0;
   ```
   In case of trim chars parameter is also column we fall back for 
non-vectorized version of trim. I guess this use case is not as common as the 
previous but it can be implemented in a follow-up patch.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to