public void set(HiveVarcharWritable val, int maxLength) { set(val.getHiveVarchar(), maxLength); }
@Override public void assignObjectValue(Object val, int destIndex) throws HiveException { if (val == null) { assignNull(destIndex); } else { // We store VARCHAR type stripped of pads. HiveVarchar hiveVarchar; if (val instanceof HiveVarchar) { hiveVarchar = (HiveVarchar) val; } else { hiveVarchar = ((HiveVarcharWritable) val).getHiveVarchar(); } byte[] bytes = hiveVarchar.getValue().getBytes(); assignBytes(bytes, 0, bytes.length, destIndex); } } }.init(outputBatch, (BytesColumnVector) destCol);
private HiveVarchar getPrimitiveWithParams(HiveVarcharWritable val) { HiveVarchar hv = new HiveVarchar(); hv.setValue(val.getHiveVarchar(), getMaxLength()); return hv; }
@Override public void assignObjectValue(Object val, int destIndex) throws HiveException { if (val == null) { assignNull(destIndex); } else { // We store VARCHAR type stripped of pads. HiveVarchar hiveVarchar; if (val instanceof HiveVarchar) { hiveVarchar = (HiveVarchar) val; } else { hiveVarchar = ((HiveVarcharWritable) val).getHiveVarchar(); } byte[] bytes = hiveVarchar.getValue().getBytes(); assignBytes(bytes, 0, bytes.length, destIndex); } } }.init(outputBatch, (BytesColumnVector) destCol);
@Override public HiveVarchar getPrimitiveJavaObject(Object o) { // check input object's length, if it doesn't match // then output a new primitive with the correct params. if (o == null) { return null; } if ((o instanceof Text) || (o instanceof TimestampWritableV2) || (o instanceof HiveDecimalWritable) || (o instanceof DoubleWritable) || (o instanceof FloatWritable) || (o instanceof LongWritable) || (o instanceof IntWritable) || (o instanceof BooleanWritable)) { String str = o.toString(); return new HiveVarchar(str, ((VarcharTypeInfo)typeInfo).getLength()); } HiveVarcharWritable writable = ((HiveVarcharWritable)o); if (doesWritableMatchTypeParams(writable)) { return writable.getHiveVarchar(); } return getPrimitiveWithParams(writable); }
@Override public HiveVarchar getPrimitiveJavaObject(Object o) { if (o == null) { return null; } HiveVarchar ret = ((LazyHiveVarchar) o).getWritableObject().getHiveVarchar(); if (!BaseCharUtils.doesPrimitiveMatchTypeParams( ret, (VarcharTypeInfo)typeInfo)) { HiveVarchar newValue = new HiveVarchar(ret, ((VarcharTypeInfo)typeInfo).getLength()); return newValue; } return ret; }
HiveVarcharWritable hvw = new HiveVarcharWritable(); hvw.readFields(in); return hvw.getHiveVarchar(); case DataType.DECIMAL: HiveDecimalWritable hdw = new HiveDecimalWritable();
string = hiveVarchar.getValue(); } else if (object instanceof HiveVarcharWritable) { HiveVarchar hiveVarchar = ((HiveVarcharWritable) object).getHiveVarchar(); string = hiveVarchar.getValue(); } else {
throw new RuntimeException("Expected LazyHiveVarchar"); HiveVarchar value = ((LazyHiveVarchar) primitiveObject).getWritableObject().getHiveVarchar(); HiveVarchar expected = ((HiveVarcharWritable) expectedObject).getHiveVarchar();
hiveVarchar = (HiveVarchar) object; } else { hiveVarchar = ((HiveVarcharWritable) object).getHiveVarchar();
hiveVarchar = (HiveVarchar) object; } else { hiveVarchar = ((HiveVarcharWritable) object).getHiveVarchar();
HiveVarchar expected = ((HiveVarcharWritable) object).getHiveVarchar(); if (!hiveVarchar.equals(expected)) { TestCase.fail("Varchar field mismatch (expected '" + expected + "' found '" + hiveVarchar + "')");
HiveVarchar expected = ((HiveVarcharWritable) object).getHiveVarchar(); if (!hiveVarchar.equals(expected)) { TestCase.fail("Varchar field mismatch (expected '" + expected + "' found '" + hiveVarchar + "')");
if (((HiveVarcharWritable) ele).getHiveVarchar().getValue().isEmpty()) { return null;
if (writableCol != null) { bcv.isNull[rowIndex] = false; HiveVarchar colHiveVarchar = ((HiveVarcharWritable) writableCol).getHiveVarchar(); byte[] bytes = colHiveVarchar.getValue().getBytes();
if (writableCol != null) { bcv.isNull[rowIndex] = false; HiveVarchar colHiveVarchar = ((HiveVarcharWritable) writableCol).getHiveVarchar(); byte[] bytes = colHiveVarchar.getValue().getBytes();
case VARCHAR: HiveVarchar value = ((HiveVarcharWritable) object).getHiveVarchar(); serializeWrite.writeHiveVarchar(value);
case VARCHAR: HiveVarchar value = ((HiveVarcharWritable) object).getHiveVarchar(); serializeWrite.writeHiveVarchar(value);
assert ((VarcharTypeInfo) ti).getLength() >= hv.getHiveVarchar().getCharacterLength();
private HiveVarchar getPrimitiveWithParams(HiveVarcharWritable val) { HiveVarchar hv = new HiveVarchar(); hv.setValue(val.getHiveVarchar(), getMaxLength()); return hv; }