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

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

                Author: ASF GitHub Bot
            Created on: 10/May/23 07:24
            Start Date: 10/May/23 07:24
    Worklog Time Spent: 10m 
      Work Description: tarak271 commented on code in PR #4094:
URL: https://github.com/apache/hive/pull/4094#discussion_r1189464969


##########
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArrayIntersect.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file intersect in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.udf.generic;
+
+import org.apache.hadoop.hive.ql.exec.Description;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * GenericUDFArrayIntersect.
+ */
+@Description(name = "array_intersect", value = "_FUNC_(array1, array2) - 
Returns an array of the elements in the intersection of array1 and array2, 
without duplicates.", extended =
+    "Example:\n" + "  > SELECT _FUNC_(array(1, 2, 3,4), array(1,2,3)) FROM 
src;\n"
+        + "  [1,2,3]") public class GenericUDFArrayIntersect extends 
AbstractGenericUDFArrayBase {

Review Comment:
   Moved that line





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

    Worklog Id:     (was: 861303)
    Time Spent: 1h 50m  (was: 1h 40m)

> implement array_intersect UDF in Hive
> -------------------------------------
>
>                 Key: HIVE-27118
>                 URL: https://issues.apache.org/jira/browse/HIVE-27118
>             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: 1h 50m
>  Remaining Estimate: 0h
>
> *array_intersect(array1, array2)*
> {{Returns an array of the elements in the intersection of array1}} and 
> {{{}array2{}}}, without duplicates.
>  
> {noformat}
> > SELECT array_intersect(array(1, 2, 2, 3), array(1, 1, 3, 5));
> [1,3]
> {noformat}
>  



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

Reply via email to