private void evaluate(LongColumnVector outV, BytesColumnVector inV, int i) { try { HiveIntervalDayTime interval = HiveIntervalDayTime.valueOf( new String(inV.vector[i], inV.start[i], inV.length[i], "UTF-8")); outV.vector[i] = DateUtils.getIntervalDayTimeTotalNanos(interval); } catch (Exception e) { outV.vector[i] = 1; outV.isNull[i] = true; outV.noNulls = false; } }
@Override void assign(int batchIndex, Object object) { if (object == null) { VectorizedBatchUtil.setNullColIsNullValue(colVector, batchIndex); } else { HiveIntervalDayTimeWritable idtw = (HiveIntervalDayTimeWritable) object; HiveIntervalDayTime idt = idtw.getHiveIntervalDayTime(); vector[batchIndex] = DateUtils.getIntervalDayTimeTotalNanos(idt); } } }
@Override public void assignObjectValue(Object val, int destIndex) throws HiveException { if (val == null) { assignNull(destIndex); } else { HiveIntervalDayTimeWritable bw = (HiveIntervalDayTimeWritable) val; assignLong( DateUtils.getIntervalDayTimeTotalNanos(bw.getHiveIntervalDayTime()), destIndex); } } }.init(outputBatch, (LongColumnVector) destCol);
@Override void apply(VectorizedRowBatch batch, int batchIndex) throws IOException { LongColumnVector colVector = (LongColumnVector) batch.cols[columnIndex]; if (deserializeRead.readCheckNull()) { VectorizedBatchUtil.setNullColIsNullValue(colVector, batchIndex); } else { deserializeRead.readIntervalDayTime(readIntervalDayTimeResults); HiveIntervalDayTime hidt = readIntervalDayTimeResults.getHiveIntervalDayTime(); colVector.vector[batchIndex] = DateUtils.getIntervalDayTimeTotalNanos(hidt); } } }
private Object getVectorTypeScalarValue(ExprNodeConstantDesc constDesc) throws HiveException { String t = constDesc.getTypeInfo().getTypeName(); VectorExpression.Type type = VectorExpression.Type.getValue(t); Object scalarValue = getScalarValue(constDesc); switch (type) { case TIMESTAMP: return TimestampUtils.getTimeNanoSec((Timestamp) scalarValue); case DATE: return DateWritable.dateToDays((Date) scalarValue); case INTERVAL_YEAR_MONTH: return ((HiveIntervalYearMonth) scalarValue).getTotalMonths(); case INTERVAL_DAY_TIME: return DateUtils.getIntervalDayTimeTotalNanos((HiveIntervalDayTime) scalarValue); default: return scalarValue; } }
case INTERVAL_DAY_TIME: return new ConstantVectorExpression(outCol, DateUtils.getIntervalDayTimeTotalNanos((HiveIntervalDayTime) constantValue)); case FLOAT_FAMILY: return new ConstantVectorExpression(outCol, ((Number) constantValue).doubleValue());
lcv.isRepeating = true; } else { lcv.fill(DateUtils.getIntervalDayTimeTotalNanos((HiveIntervalDayTime) value)); lcv.isNull[0] = false;
if (writableCol != null) { HiveIntervalDayTime i = ((HiveIntervalDayTimeWritable) writableCol).getHiveIntervalDayTime(); lcv.vector[rowIndex] = DateUtils.getIntervalDayTimeTotalNanos(i); lcv.isNull[rowIndex] = false; } else {