[ 
https://issues.apache.org/jira/browse/HIVE-26889?focusedWorklogId=838511&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-838511
 ]

ASF GitHub Bot logged work on HIVE-26889:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Jan/23 04:04
            Start Date: 11/Jan/23 04:04
    Worklog Time Spent: 10m 
      Work Description: SourabhBadhya commented on code in PR #3896:
URL: https://github.com/apache/hive/pull/3896#discussion_r1066553884


##########
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/AbstractGenericUDFArrayBase.java:
##########
@@ -67,6 +76,8 @@ public ObjectInspector initialize(ObjectInspector[] arguments)
         argumentOIs = arguments;
         if (outputCategory == ObjectInspector.Category.LIST) {
             return initListOI(arguments);
+        } else if (outputCategory == ObjectInspector.Category.PRIMITIVE && 
outputPrimitiveCategory == PrimitiveObjectInspector.PrimitiveCategory.STRING) {
+            return 
PrimitiveObjectInspectorFactory.writableStringObjectInspector;

Review Comment:
   I feel its better to push this down to GenericUDFArrayJoin by overriding 
initialize in GenericUDFArrayJoin. This condition seems specific to Array join 
and I dont see this condition used by other potential UDFs.
   
   This will avoid the addition of another constructor as well to this generic 
class.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 838511)
    Time Spent: 40m  (was: 0.5h)

> Implement array_join udf to concatenate the elements of an array with a 
> specified delimiter
> -------------------------------------------------------------------------------------------
>
>                 Key: HIVE-26889
>                 URL: https://issues.apache.org/jira/browse/HIVE-26889
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Hive
>            Reporter: Taraka Rama Rao Lethavadla
>            Assignee: Taraka Rama Rao Lethavadla
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> *array_join(array, delimiter, replaceNull)* - concatenate the elements of an 
> array with a specified delimiter
> Example:
> {noformat}
> > SELECT array_join(array(1, 2, 3,4), ',') FROM src LIMIT 1;
> 1,2,3,4
> > SELECT array_join(array(1, 2, NULL, 4), ',',':') FROM src LIMIT 1;
> 1,2,:,4{noformat}
> Returns NULL if array is null/empty



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to