org.apache.hadoop.hive.ql.exec.vector.expressions
Class CastDecimalToDecimal

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression
      extended by org.apache.hadoop.hive.ql.exec.vector.expressions.CastDecimalToDecimal
All Implemented Interfaces:
Serializable

public class CastDecimalToDecimal
extends VectorExpression

Cast a decimal to a decimal, accounting for precision and scale changes. If other functions besides cast need to take a decimal in and produce a decimal, you can subclass this class or convert it to a superclass, and implement different methods for each operation. If that's done, the convert() method should be renamed to func() for consistency with other similar super classes such as FuncLongToDecimal.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression
VectorExpression.Type
 
Constructor Summary
CastDecimalToDecimal()
           
CastDecimalToDecimal(int inputColumn, int outputColumn)
           
 
Method Summary
 void evaluate(VectorizedRowBatch batch)
          Cast decimal(p1, s1) to decimal(p2, s2).
 VectorExpressionDescriptor.Descriptor getDescriptor()
           
 int getInputColumn()
           
 int getOutputColumn()
          Returns the index of the output column in the array of column vectors.
 void setInputColumn(int inputColumn)
           
 void setOutputColumn(int outputColumn)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression
getChildExpressions, getInputTypes, getOutputType, setChildExpressions, setInputTypes, setOutputType, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CastDecimalToDecimal

public CastDecimalToDecimal(int inputColumn,
                            int outputColumn)

CastDecimalToDecimal

public CastDecimalToDecimal()
Method Detail

evaluate

public void evaluate(VectorizedRowBatch batch)
Cast decimal(p1, s1) to decimal(p2, s2). The precision and scale are recorded in the input and output vectors, respectively.

Specified by:
evaluate in class VectorExpression

getOutputColumn

public int getOutputColumn()
Description copied from class: VectorExpression
Returns the index of the output column in the array of column vectors. If not applicable, -1 is returned.

Specified by:
getOutputColumn in class VectorExpression
Returns:
Index of the output column

setOutputColumn

public void setOutputColumn(int outputColumn)

getInputColumn

public int getInputColumn()

setInputColumn

public void setInputColumn(int inputColumn)

getDescriptor

public VectorExpressionDescriptor.Descriptor getDescriptor()
Specified by:
getDescriptor in class VectorExpression


Copyright © 2014 The Apache Software Foundation. All rights reserved.