hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Work logged] (HIVE-22463) Support Decimal64 column multiplication with decimal64 Column/Scalar
Date Thu, 21 Nov 2019 17:15:00 GMT

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

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

                Author: ASF GitHub Bot
            Created on: 21/Nov/19 17:14
            Start Date: 21/Nov/19 17:14
    Worklog Time Spent: 10m 
      Work Description: t3rmin4t0r commented on pull request #846: HIVE-22463 decimal64 multiplication
URL: https://github.com/apache/hive/pull/846#discussion_r348773487
 
 

 ##########
 File path: ql/src/gen/vectorization/ExpressionTemplates/Decimal64ColumnMultiplyDecimal64Scalar.txt
 ##########
 @@ -0,0 +1,219 @@
+/*
+ * 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 except 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.exec.vector.expressions.gen;
+
+import java.util.Arrays;
+
+import org.apache.hadoop.hive.ql.exec.vector.Decimal64ColumnVector;
+import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.Decimal64Util;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression;
+import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable;
+import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+
+/**
+ * Generated from template ColumnArithmeticScalar.txt, which covers decimal64 arithmetic
+ * expressions between a column and a scalar.
+ */
+public class <ClassName> extends VectorExpression {
+
+  private static final long serialVersionUID = 1L;
+
+  private final int colNum;
+  private final long value;
+
+  public <ClassName>(int colNum, long value, int outputColumnNum) {
+    super(outputColumnNum);
+    this.colNum = colNum;
+    this.value = value;
+  }
+
+  public <ClassName>() {
+    super();
+
+    // Dummy final assignments.
+    colNum = -1;
+    value = 0;
+  }
+
+  @Override
+  public void evaluate(VectorizedRowBatch batch) throws HiveException {
+
+    // return immediately if batch is empty
+    final int n = batch.size;
+    if (n == 0) {
+      return;
+    }
+
+    if (childExpressions != null) {
+      super.evaluateChildren(batch);
+    }
+
+    Decimal64ColumnVector inputColVector = (Decimal64ColumnVector) batch.cols[colNum];
+    Decimal64ColumnVector outputColVector = (Decimal64ColumnVector) batch.cols[outputColumnNum];
+    int[] sel = batch.selected;
+    boolean[] inputIsNull = inputColVector.isNull;
+    boolean[] outputIsNull = outputColVector.isNull;
+
+    // We do not need to do a column reset since we are carefully changing the output.
+    outputColVector.isRepeating = false;
+
+    long[] vector = inputColVector.vector;
+    long[] outputVector = outputColVector.vector;
+
+    final long outputDecimal64AbsMax =
+        HiveDecimalWritable.getDecimal64AbsMax(outputColVector.precision);
+    DecimalTypeInfo lDecimalTypeInfo = (DecimalTypeInfo) inputTypeInfos[0];
+    DecimalTypeInfo rDecimalTypeInfo = (DecimalTypeInfo) inputTypeInfos[1];
+    HiveDecimalWritable writable = new HiveDecimalWritable();
+    writable.deserialize64(value, lDecimalTypeInfo.scale() - rDecimalTypeInfo.scale());
 
 Review comment:
   Does this operation belong within the evaluate() - looks like several of these parameters
do not change across evaluate() calls 
 
----------------------------------------------------------------
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:
users@infra.apache.org


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

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

> Support Decimal64 column multiplication with decimal64 Column/Scalar
> --------------------------------------------------------------------
>
>                 Key: HIVE-22463
>                 URL: https://issues.apache.org/jira/browse/HIVE-22463
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ramesh Kumar Thangarajan
>            Assignee: Ramesh Kumar Thangarajan
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-22463.1.patch, HIVE-22463.2.patch, HIVE-22463.3.patch, HIVE-22463.5.patch,
HIVE-22463.6.patch, HIVE-22463.7.patch, HIVE-22463.8.patch
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Support Decimal64 column multiplication with decimal64 Column/Scalar



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message