org.apache.orc.storage.ql.exec.vector.LongColumnVector Java Examples
The following examples show how to use
org.apache.orc.storage.ql.exec.vector.LongColumnVector.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getLong(column); } }
Example #2
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getInt(column); } }
Example #3
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getShort(column); } }
Example #4
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getByte(column); } }
Example #5
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getBoolean(column) ? 1 : 0; } }
Example #6
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeArrayWriter writer, int element, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNull(element); } else { writer.write(element, ((LongColumnVector) vector).vector[row]); } }
Example #7
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeRowWriter writer, int column, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNullAt(column); } else { writer.write(column, ((LongColumnVector) vector).vector[row]); } }
Example #8
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeArrayWriter writer, int element, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNull(element); } else { writer.write(element, (int) ((LongColumnVector) vector).vector[row]); } }
Example #9
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeRowWriter writer, int column, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNullAt(column); } else { writer.write(column, (int) ((LongColumnVector) vector).vector[row]); } }
Example #10
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeArrayWriter writer, int element, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNull(element); } else { writer.write(element, (short) ((LongColumnVector) vector).vector[row]); } }
Example #11
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeRowWriter writer, int column, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNullAt(column); } else { writer.write(column, (short) ((LongColumnVector) vector).vector[row]); } }
Example #12
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeArrayWriter writer, int element, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNull(element); } else { writer.write(element, (byte) ((LongColumnVector) vector).vector[row]); } }
Example #13
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeRowWriter writer, int column, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNullAt(column); } else { writer.write(column, (byte) ((LongColumnVector) vector).vector[row]); } }
Example #14
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeArrayWriter writer, int element, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNull(element); } else { writer.write(element, ((LongColumnVector) vector).vector[row] != 0); } }
Example #15
Source File: SparkOrcReader.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void convert(UnsafeRowWriter writer, int column, ColumnVector vector, int row) { if (vector.isRepeating) { row = 0; } if (!vector.noNulls && vector.isNull[row]) { writer.setNullAt(column); } else { writer.write(column, ((LongColumnVector) vector).vector[row] != 0); } }
Example #16
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getInt(column); } }
Example #17
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getShort(column); } }
Example #18
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getByte(column); } }
Example #19
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getBoolean(column) ? 1 : 0; } }
Example #20
Source File: SparkOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
public void addValue(int rowId, int column, SpecializedGetters data, ColumnVector output) { if (data.isNullAt(column)) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data.getLong(column); } }
Example #21
Source File: AbstractOrcNoHiveVector.java From flink with Apache License 2.0 | 5 votes |
private static LongColumnVector createLongVector(int batchSize, Object value) { LongColumnVector lcv = new LongColumnVector(batchSize); if (value == null) { lcv.noNulls = false; lcv.isNull[0] = true; lcv.isRepeating = true; } else { lcv.fill(((Number) value).longValue()); lcv.isNull[0] = false; } return lcv; }
Example #22
Source File: GenericOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, LocalDate data, ColumnVector output) { if (data == null) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = ChronoUnit.DAYS.between(EPOCH_DAY, data); } }
Example #23
Source File: GenericOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, Long data, ColumnVector output) { if (data == null) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data; } }
Example #24
Source File: GenericOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, Integer data, ColumnVector output) { if (data == null) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data; } }
Example #25
Source File: GenericOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, Short data, ColumnVector output) { if (data == null) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data; } }
Example #26
Source File: GenericOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, Byte data, ColumnVector output) { if (data == null) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data; } }
Example #27
Source File: GenericOrcWriter.java From iceberg with Apache License 2.0 | 5 votes |
@Override public void addValue(int rowId, Boolean data, ColumnVector output) { if (data == null) { output.noNulls = false; output.isNull[rowId] = true; } else { output.isNull[rowId] = false; ((LongColumnVector) output).vector[rowId] = data ? 1 : 0; } }
Example #28
Source File: OrcColumnarRowSplitReaderNoHiveTest.java From flink with Apache License 2.0 | 4 votes |
@Override protected void prepareReadFileWithTypes(String file, int rowSize) throws IOException { // NOTE: orc has field name information, so name should be same as orc TypeDescription schema = TypeDescription.fromString( "struct<" + "f0:float," + "f1:double," + "f2:timestamp," + "f3:tinyint," + "f4:smallint" + ">"); org.apache.hadoop.fs.Path filePath = new org.apache.hadoop.fs.Path(file); Configuration conf = new Configuration(); Writer writer = OrcFile.createWriter(filePath, OrcFile.writerOptions(conf).setSchema(schema)); VectorizedRowBatch batch = schema.createRowBatch(rowSize); DoubleColumnVector col0 = (DoubleColumnVector) batch.cols[0]; DoubleColumnVector col1 = (DoubleColumnVector) batch.cols[1]; TimestampColumnVector col2 = (TimestampColumnVector) batch.cols[2]; LongColumnVector col3 = (LongColumnVector) batch.cols[3]; LongColumnVector col4 = (LongColumnVector) batch.cols[4]; col0.noNulls = false; col1.noNulls = false; col2.noNulls = false; col3.noNulls = false; col4.noNulls = false; for (int i = 0; i < rowSize - 1; i++) { col0.vector[i] = i; col1.vector[i] = i; Timestamp timestamp = toTimestamp(i); col2.time[i] = timestamp.getTime(); col2.nanos[i] = timestamp.getNanos(); col3.vector[i] = i; col4.vector[i] = i; } col0.isNull[rowSize - 1] = true; col1.isNull[rowSize - 1] = true; col2.isNull[rowSize - 1] = true; col3.isNull[rowSize - 1] = true; col4.isNull[rowSize - 1] = true; batch.size = rowSize; writer.addRowBatch(batch); batch.reset(); writer.close(); }
Example #29
Source File: OrcNoHiveLongVector.java From flink with Apache License 2.0 | 4 votes |
public OrcNoHiveLongVector(LongColumnVector vector) { super(vector); this.vector = vector; }
Example #30
Source File: OrcValueReaders.java From iceberg with Apache License 2.0 | 4 votes |
@Override public Boolean nonNullRead(ColumnVector vector, int row) { return ((LongColumnVector) vector).vector[row] != 0; }