@Override public boolean isNullAt(int ordinal) { return data.isNullAt(offset + ordinal); }
@Override public boolean isNullAt(int ordinal) { return columns[ordinal].isNullAt(rowId); }
/** * Sets the number of rows that are valid. Additionally, marks all rows as "filtered" if one or * more of their attributes are part of a non-nullable column. */ public void setNumRows(int numRows) { assert(numRows <= this.capacity); this.numRows = numRows; for (int ordinal : nullFilteredColumns) { if (columns[ordinal].numNulls != 0) { for (int rowId = 0; rowId < numRows; rowId++) { if (!filteredRows[rowId] && columns[ordinal].isNullAt(rowId)) { filteredRows[rowId] = true; ++numRowsFiltered; } } } } }
@Override public byte[] getBinary(int ordinal) { if (columns[ordinal].isNullAt(rowId)) return null; return columns[ordinal].getBinary(rowId); }
@Override public UTF8String getUTF8String(int ordinal) { if (columns[ordinal].isNullAt(rowId)) return null; return columns[ordinal].getUTF8String(rowId); }
@Override public Decimal getDecimal(int ordinal, int precision, int scale) { if (columns[ordinal].isNullAt(rowId)) return null; return columns[ordinal].getDecimal(rowId, precision, scale); }
@Override public InternalRow getStruct(int ordinal, int numFields) { if (columns[ordinal].isNullAt(rowId)) return null; return columns[ordinal].getStruct(rowId); }
@Override public ArrayData getArray(int ordinal) { if (columns[ordinal].isNullAt(rowId)) return null; return columns[ordinal].getArray(rowId); }
/** * Returns the array data as the java primitive array. * For example, an array of IntegerType will return an int[]. * Throws exceptions for unhandled schemas. */ public static Object toPrimitiveJavaArray(ColumnVector.Array array) { DataType dt = array.data.dataType(); if (dt instanceof IntegerType) { int[] result = new int[array.length]; ColumnVector data = array.data; for (int i = 0; i < result.length; i++) { if (data.isNullAt(array.offset + i)) { throw new RuntimeException("Cannot handle NULL values."); } result[i] = data.getInt(array.offset + i); } return result; } else { throw new UnsupportedOperationException(); } }
if (!data.isNullAt(offset + i)) { list[i] = data.getBoolean(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getByte(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getShort(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getInt(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getFloat(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getDouble(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getLong(offset + i); DecimalType decType = (DecimalType)dt; for (int i = 0; i < length; i++) { if (!data.isNullAt(offset + i)) { list[i] = getDecimal(i, decType.precision(), decType.scale()); if (!data.isNullAt(offset + i)) { list[i] = getUTF8String(i).toString();
@Override public CalendarInterval getInterval(int ordinal) { if (columns[ordinal].isNullAt(rowId)) return null; final int months = columns[ordinal].getChildColumn(0).getInt(rowId); final long microseconds = columns[ordinal].getChildColumn(1).getLong(rowId); return new CalendarInterval(months, microseconds); }
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))); DecimalType.is64BitDecimalType(column.dataType())) { 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 (!column.isNullAt(i)) { Binary v = dictionary.decodeToBinary(dictionaryIds.getDictId(i)); column.putLong(i, ParquetRowConverter.binaryToSQLTimestamp(v));
@Override public boolean isNullAt(int ordinal) { return columns[ordinal].isNullAt(rowId); }
@Override public boolean isNullAt(int i) { return vector.isNullAt(i); }
@Override public boolean isNullAt(int ordinal) { return data.isNullAt(offset + ordinal); }
/** * Sets the number of rows that are valid. Additionally, marks all rows as "filtered" if one or * more of their attributes are part of a non-nullable column. */ public void setNumRows(int numRows) { assert(numRows <= this.capacity); this.numRows = numRows; for (int ordinal : nullFilteredColumns) { if (columns[ordinal].numNulls != 0) { for (int rowId = 0; rowId < numRows; rowId++) { if (!filteredRows[rowId] && columns[ordinal].isNullAt(rowId)) { filteredRows[rowId] = true; ++numRowsFiltered; } } } } }
@Override public boolean isNullAt(int i) { checkPageLoaded(); return vector.isNullAt(i); }
/** * Returns the array data as the java primitive array. * For example, an array of IntegerType will return an int[]. * Throws exceptions for unhandled schemas. */ public static Object toPrimitiveJavaArray(ColumnVector.Array array) { DataType dt = array.data.dataType(); if (dt instanceof IntegerType) { int[] result = new int[array.length]; ColumnVector data = array.data; for (int i = 0; i < result.length; i++) { if (data.isNullAt(array.offset + i)) { throw new RuntimeException("Cannot handle NULL values."); } result[i] = data.getInt(array.offset + i); } return result; } else { throw new UnsupportedOperationException(); } }
if (!data.isNullAt(offset + i)) { list[i] = data.getBoolean(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getByte(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getShort(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getInt(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getFloat(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getDouble(offset + i); if (!data.isNullAt(offset + i)) { list[i] = data.getLong(offset + i); DecimalType decType = (DecimalType)dt; for (int i = 0; i < length; i++) { if (!data.isNullAt(offset + i)) { list[i] = getDecimal(i, decType.precision(), decType.scale()); if (!data.isNullAt(offset + i)) { list[i] = getUTF8String(i).toString();
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))); DecimalType.is64BitDecimalType(column.dataType())) { 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.putFloat(i, dictionary.decodeToFloat(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { column.putDouble(i, dictionary.decodeToDouble(dictionaryIds.getDictId(i))); if (!column.isNullAt(i)) { Binary v = dictionary.decodeToBinary(dictionaryIds.getDictId(i)); column.putLong(i, ParquetRowConverter.binaryToSQLTimestamp(v)); if (!column.isNullAt(i)) { Binary v = dictionary.decodeToBinary(dictionaryIds.getDictId(i)); column.putByteArray(i, v.getBytes());