Skip to content

Commit

Permalink
pack value with zone utc in plain values decoder for batch reader
Browse files Browse the repository at this point in the history
  • Loading branch information
auden-woolfson committed Sep 24, 2024
1 parent d3e9dbe commit 361d23a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ protected QueryRunner createQueryRunner() throws Exception
public Object[][] createTestTimestampWithTimezoneData()
{
return new Object[][] {
{getBatchReaderEnabledQueryRunner()},
{getQueryRunner()}
{getQueryRunner()},
{getBatchReaderEnabledQueryRunner()}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import com.facebook.presto.parquet.batchreader.decoders.ValuesDecoder.Int64TimeAndTimestampMicrosValuesDecoder;
import org.openjdk.jol.info.ClassLayout;

import static com.facebook.presto.common.type.DateTimeEncoding.packDateTimeWithZone;
import static com.facebook.presto.common.type.TimeZoneKey.UTC_KEY;
import static com.google.common.base.Preconditions.checkArgument;
import static io.airlift.slice.SizeOf.sizeOf;
import static java.util.concurrent.TimeUnit.MICROSECONDS;
Expand Down Expand Up @@ -49,7 +51,8 @@ public void readNext(long[] values, int offset, int length)
int localBufferOffset = bufferOffset;

while (offset < endOffset) {
values[offset++] = MICROSECONDS.toMillis(BytesUtils.getLong(localByteBuffer, localBufferOffset));
long utcMillis = MICROSECONDS.toMillis(BytesUtils.getLong(localByteBuffer, localBufferOffset));
values[offset++] = packDateTimeWithZone(utcMillis, UTC_KEY);
localBufferOffset += 8;
}

Expand Down

0 comments on commit 361d23a

Please sign in to comment.