You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "amanraj2520 (via GitHub)" <gi...@apache.org> on 2023/10/03 11:43:32 UTC

[PR] HIVE-27765 : Backport of HIVE-20052: Arrow serde should fill ArrowColumnVector(Decimal) with the given schema precision/scale [hive]

amanraj2520 opened a new pull request, #4772:
URL: https://github.com/apache/hive/pull/4772

   JIRA link - HIVE-27765


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-27765 : Backport of HIVE-20052, HIVE-20093, HIVE-20203, HIVE-20290, HIVE-20300, HIVE-20312, HIVE-20044, HIVE-21966 [hive]

Posted by "sankarh (via GitHub)" <gi...@apache.org>.
sankarh merged PR #4772:
URL: https://github.com/apache/hive/pull/4772


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-27765 : Backport of HIVE-20052, HIVE-20093, HIVE-20203, HIVE-20290, HIVE-20300, HIVE-20312, HIVE-20044, HIVE-21966 [hive]

Posted by "sankarh (via GitHub)" <gi...@apache.org>.
sankarh commented on code in PR #4772:
URL: https://github.com/apache/hive/pull/4772#discussion_r1351439806


##########
ql/src/java/org/apache/hadoop/hive/ql/io/arrow/Serializer.java:
##########
@@ -485,14 +493,23 @@ private void writePrimitive(FieldVector arrowVector, ColumnVector hiveVector, Ty
         break;
       case DECIMAL:
         {
-          final DecimalVector decimalVector = (DecimalVector) arrowVector;
-          final int scale = decimalVector.getScale();
-          for (int i = 0; i < size; i++) {
-            if (hiveVector.isNull[i]) {
-              decimalVector.setNull(i);
-            } else {
-              decimalVector.set(i,
-                  ((DecimalColumnVector) hiveVector).vector[i].getHiveDecimal().bigDecimalValue().setScale(scale));
+          try (ArrowBuf arrowBuf = serDe.rootAllocator.buffer(DecimalHolder.WIDTH)) {

Review Comment:
   In the original patch, the try-catch block was limited to smaller code block. Why is it changed here?



##########
ql/src/java/org/apache/hadoop/hive/ql/io/arrow/Serializer.java:
##########
@@ -485,14 +493,23 @@ private void writePrimitive(FieldVector arrowVector, ColumnVector hiveVector, Ty
         break;
       case DECIMAL:
         {
-          final DecimalVector decimalVector = (DecimalVector) arrowVector;
-          final int scale = decimalVector.getScale();
-          for (int i = 0; i < size; i++) {
-            if (hiveVector.isNull[i]) {
-              decimalVector.setNull(i);
-            } else {
-              decimalVector.set(i,
-                  ((DecimalColumnVector) hiveVector).vector[i].getHiveDecimal().bigDecimalValue().setScale(scale));
+          try (ArrowBuf arrowBuf = serDe.rootAllocator.buffer(DecimalHolder.WIDTH)) {

Review Comment:
   In the original patch, the try-catch block was limited to smaller code block. Why is it changed here?



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org