@Override public final ColumnarArray getArray(int rowId) { if (isNullAt(rowId)) return null; return new ColumnarArray(arrayData(), getArrayOffset(rowId), getArrayLength(rowId)); }
@Override public final ColumnarArray getArray(int rowId) { if (isNullAt(rowId)) return null; return new ColumnarArray(arrayData(), getArrayOffset(rowId), getArrayLength(rowId)); }
@Override public Decimal getDecimal(int rowId, int precision, int scale) { if (isNullAt(rowId)) return null; if (precision <= Decimal.MAX_INT_DIGITS()) { return Decimal.createUnsafe(getInt(rowId), precision, scale); } else if (precision <= Decimal.MAX_LONG_DIGITS()) { return Decimal.createUnsafe(getLong(rowId), precision, scale); } else { // TODO: best perf? byte[] bytes = getBinary(rowId); BigInteger bigInteger = new BigInteger(bytes); BigDecimal javaDecimal = new BigDecimal(bigInteger, scale); return Decimal.apply(javaDecimal, precision, scale); } }
@Override public final ColumnarMap getMap(int rowId) { if (isNullAt(rowId)) return null; return new ColumnarMap(getChild(0), getChild(1), getArrayOffset(rowId), getArrayLength(rowId)); }
@Override public final ColumnarMap getMap(int rowId) { if (isNullAt(rowId)) return null; return new ColumnarMap(getChild(0), getChild(1), getArrayOffset(rowId), getArrayLength(rowId)); }
@Override public Decimal getDecimal(int rowId, int precision, int scale) { if (isNullAt(rowId)) return null; if (precision <= Decimal.MAX_INT_DIGITS()) { return Decimal.createUnsafe(getInt(rowId), precision, scale); } else if (precision <= Decimal.MAX_LONG_DIGITS()) { return Decimal.createUnsafe(getLong(rowId), precision, scale); } else { // TODO: best perf? byte[] bytes = getBinary(rowId); BigInteger bigInteger = new BigInteger(bytes); BigDecimal javaDecimal = new BigDecimal(bigInteger, scale); return Decimal.apply(javaDecimal, precision, scale); } }
@Override public byte[] getBinary(int rowId) { if (isNullAt(rowId)) return null; if (dictionary == null) { return arrayData().getBytes(getArrayOffset(rowId), getArrayLength(rowId)); } else { return dictionary.decodeToBinary(dictionaryIds.getDictId(rowId)); } }
@Override public byte[] getBinary(int rowId) { if (isNullAt(rowId)) return null; if (dictionary == null) { return arrayData().getBytes(getArrayOffset(rowId), getArrayLength(rowId)); } else { return dictionary.decodeToBinary(dictionaryIds.getDictId(rowId)); } }
@Override public UTF8String getUTF8String(int rowId) { if (isNullAt(rowId)) return null; if (dictionary == null) { return arrayData().getBytesAsUTF8String(getArrayOffset(rowId), getArrayLength(rowId)); } else { byte[] bytes = dictionary.decodeToBinary(dictionaryIds.getDictId(rowId)); return UTF8String.fromBytes(bytes); } }
@Override public UTF8String getUTF8String(int rowId) { if (isNullAt(rowId)) return null; if (dictionary == null) { return arrayData().getBytesAsUTF8String(getArrayOffset(rowId), getArrayLength(rowId)); } else { byte[] bytes = dictionary.decodeToBinary(dictionaryIds.getDictId(rowId)); return UTF8String.fromBytes(bytes); } }
DecimalType.is32BitDecimalType(column.dataType())) { for (int i = rowId; i < rowId + num; ++i) { if (!column.isNullAt(i)) { column.putInt(i, dictionary.decodeToInt(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { column.putByte(i, (byte) dictionary.decodeToInt(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { column.putShort(i, (short) dictionary.decodeToInt(dictionaryIds.getDictId(i))); originalType == OriginalType.TIMESTAMP_MICROS) { for (int i = rowId; i < rowId + num; ++i) { if (!column.isNullAt(i)) { column.putLong(i, dictionary.decodeToLong(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { column.putLong(i, DateTimeUtils.fromMillis(dictionary.decodeToLong(dictionaryIds.getDictId(i)))); if (!column.isNullAt(i)) { column.putFloat(i, dictionary.decodeToFloat(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { column.putDouble(i, dictionary.decodeToDouble(dictionaryIds.getDictId(i))); if (!shouldConvertTimestamps()) { for (int i = rowId; i < rowId + num; ++i) { if (!column.isNullAt(i)) {
DecimalType.is32BitDecimalType(column.dataType())) { for (int i = rowId; i < rowId + num; ++i) { if (!column.isNullAt(i)) { column.putInt(i, dictionary.decodeToInt(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { column.putByte(i, (byte) dictionary.decodeToInt(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { column.putShort(i, (short) dictionary.decodeToInt(dictionaryIds.getDictId(i))); originalType == OriginalType.TIMESTAMP_MICROS) { for (int i = rowId; i < rowId + num; ++i) { if (!column.isNullAt(i)) { column.putLong(i, dictionary.decodeToLong(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { column.putLong(i, DateTimeUtils.fromMillis(dictionary.decodeToLong(dictionaryIds.getDictId(i)))); if (!column.isNullAt(i)) { column.putFloat(i, dictionary.decodeToFloat(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { column.putDouble(i, dictionary.decodeToDouble(dictionaryIds.getDictId(i))); if (!shouldConvertTimestamps()) { for (int i = rowId; i < rowId + num; ++i) { if (!column.isNullAt(i)) {