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

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

                Author: ASF GitHub Bot
            Created on: 25/Jul/22 17:25
            Start Date: 25/Jul/22 17:25
    Worklog Time Spent: 10m 
      Work Description: scarlin-cloudera commented on code in PR #3433:
URL: https://github.com/apache/hive/pull/3433#discussion_r929127785


##########
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java:
##########
@@ -85,6 +107,31 @@ public Text evaluate(Text t, IntWritable pos, IntWritable 
len) {
     return r;
   }
 
+  private int[] makeIndex(long pos, long len, int inputLen) {
+    if ((Math.abs(pos) > inputLen)) {
+      return null;
+    }
+
+    long start, end;
+
+    if (pos > 0) {
+      start = pos - 1;
+    } else if (pos < 0) {
+      start = inputLen + pos;
+    } else {
+      start = 0;
+    }
+
+    if ((inputLen - start) < len) {
+      end = inputLen;
+    } else {
+      end = start + len;
+    }
+    index[0] = (int) start;
+    index[1] = (int) end;
+    return index;
+  }

Review Comment:
   Done





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

    Worklog Id:     (was: 794991)
    Time Spent: 50m  (was: 40m)

> Allow substr to take bigint as parameters
> -----------------------------------------
>
>                 Key: HIVE-26294
>                 URL: https://issues.apache.org/jira/browse/HIVE-26294
>             Project: Hive
>          Issue Type: Improvement
>          Components: Types
>            Reporter: Steve Carlin
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Small enhancement
> Impala allows a bigint as an argument for the substr function. We should 
> allow Hive to allow bigint arguments too.



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

Reply via email to