use of org.apache.orc.storage.ql.exec.vector.DecimalColumnVector in project incubator-gobblin by apache.
the class GobblinBaseOrcWriter method removeRefOfColumnVectorChild.
/**
* Set the child field of {@link ColumnVector} to null, assuming input {@link ColumnVector} is nonNull.
*/
private void removeRefOfColumnVectorChild(ColumnVector cv) {
if (cv instanceof StructColumnVector) {
StructColumnVector structCv = (StructColumnVector) cv;
for (ColumnVector childCv : structCv.fields) {
removeRefOfColumnVectorChild(childCv);
}
} else if (cv instanceof ListColumnVector) {
ListColumnVector listCv = (ListColumnVector) cv;
removeRefOfColumnVectorChild(listCv.child);
} else if (cv instanceof MapColumnVector) {
MapColumnVector mapCv = (MapColumnVector) cv;
removeRefOfColumnVectorChild(mapCv.keys);
removeRefOfColumnVectorChild(mapCv.values);
} else if (cv instanceof UnionColumnVector) {
UnionColumnVector unionCv = (UnionColumnVector) cv;
for (ColumnVector unionChildCv : unionCv.fields) {
removeRefOfColumnVectorChild(unionChildCv);
}
} else if (cv instanceof LongColumnVector) {
((LongColumnVector) cv).vector = null;
} else if (cv instanceof DoubleColumnVector) {
((DoubleColumnVector) cv).vector = null;
} else if (cv instanceof BytesColumnVector) {
((BytesColumnVector) cv).vector = null;
((BytesColumnVector) cv).start = null;
((BytesColumnVector) cv).length = null;
} else if (cv instanceof DecimalColumnVector) {
((DecimalColumnVector) cv).vector = null;
}
}
use of org.apache.orc.storage.ql.exec.vector.DecimalColumnVector in project flink by apache.
the class AbstractOrcNoHiveVector method createDecimalVector.
private static DecimalColumnVector createDecimalVector(int batchSize, int precision, int scale, Object value) {
DecimalColumnVector dv = new DecimalColumnVector(batchSize, precision, scale);
if (value == null) {
dv.noNulls = false;
dv.isNull[0] = true;
dv.isRepeating = true;
} else {
dv.set(0, value instanceof HiveDecimal ? (HiveDecimal) value : HiveDecimal.create((BigDecimal) value));
dv.isRepeating = true;
dv.isNull[0] = false;
}
return dv;
}
Aggregations