|
16 | 16 | import com.facebook.presto.common.block.Block;
|
17 | 17 | import com.facebook.presto.common.block.LongArrayBlock;
|
18 | 18 | import com.facebook.presto.common.block.RunLengthEncodedBlock;
|
| 19 | +import com.facebook.presto.common.type.TimestampWithTimeZoneType; |
19 | 20 | import com.facebook.presto.parquet.RichColumnDescriptor;
|
20 | 21 | import com.facebook.presto.parquet.batchreader.decoders.ValuesDecoder.Int64TimeAndTimestampMicrosValuesDecoder;
|
21 | 22 | import com.facebook.presto.parquet.reader.ColumnChunk;
|
@@ -64,7 +65,12 @@ protected ColumnChunk readNestedWithNull()
|
64 | 65 | boolean[] isNull = new boolean[newBatchSize];
|
65 | 66 | int offset = 0;
|
66 | 67 | for (ValuesDecoderContext valuesDecoderContext : definitionLevelDecodingContext.getValuesDecoderContexts()) {
|
67 |
| - ((Int64TimeAndTimestampMicrosValuesDecoder) valuesDecoderContext.getValuesDecoder()).readNext(values, offset, valuesDecoderContext.getNonNullCount()); |
| 68 | + if (field.getType() instanceof TimestampWithTimeZoneType) { |
| 69 | + ((Int64TimeAndTimestampMicrosValuesDecoder) valuesDecoderContext.getValuesDecoder()).readNextWithTimezone(values, offset, valuesDecoderContext.getNonNullCount()); |
| 70 | + } |
| 71 | + else { |
| 72 | + ((Int64TimeAndTimestampMicrosValuesDecoder) valuesDecoderContext.getValuesDecoder()).readNext(values, offset, valuesDecoderContext.getNonNullCount()); |
| 73 | + } |
68 | 74 |
|
69 | 75 | int valueDestinationIndex = offset + valuesDecoderContext.getValueCount() - 1;
|
70 | 76 | int valueSourceIndex = offset + valuesDecoderContext.getNonNullCount() - 1;
|
@@ -112,7 +118,12 @@ protected ColumnChunk readNestedNoNull()
|
112 | 118 | long[] values = new long[newBatchSize];
|
113 | 119 | int offset = 0;
|
114 | 120 | for (ValuesDecoderContext valuesDecoderContext : definitionLevelDecodingContext.getValuesDecoderContexts()) {
|
115 |
| - ((Int64TimeAndTimestampMicrosValuesDecoder) valuesDecoderContext.getValuesDecoder()).readNext(values, offset, valuesDecoderContext.getNonNullCount()); |
| 121 | + if (field.getType() instanceof TimestampWithTimeZoneType) { |
| 122 | + ((Int64TimeAndTimestampMicrosValuesDecoder) valuesDecoderContext.getValuesDecoder()).readNextWithTimezone(values, offset, valuesDecoderContext.getNonNullCount()); |
| 123 | + } |
| 124 | + else { |
| 125 | + ((Int64TimeAndTimestampMicrosValuesDecoder) valuesDecoderContext.getValuesDecoder()).readNext(values, offset, valuesDecoderContext.getNonNullCount()); |
| 126 | + } |
116 | 127 | offset += valuesDecoderContext.getValueCount();
|
117 | 128 | }
|
118 | 129 |
|
|
0 commit comments