Skip to content

Commit

Permalink
Add sessionTimezone and adjustTimestampToTimezone to DWRF reader and …
Browse files Browse the repository at this point in the history
…writer options
  • Loading branch information
wypb committed Sep 27, 2024
1 parent f099582 commit 05a1673
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions velox/dwio/dwrf/reader/ReaderBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ FooterStatisticsImpl::FooterStatisticsImpl(
}
}

ReaderBase::ReaderBase(
MemoryPool& pool,
std::unique_ptr<dwio::common::BufferedInput> input,
FileFormat fileFormat)
: ReaderBase(createReaderOptions(pool, fileFormat), std::move(input)) {}

ReaderBase::ReaderBase(
const dwio::common::ReaderOptions& options,
std::unique_ptr<dwio::common::BufferedInput> input)
Expand Down
15 changes: 15 additions & 0 deletions velox/dwio/dwrf/reader/ReaderBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ class ReaderBase {
const dwio::common::ReaderOptions& options,
std::unique_ptr<dwio::common::BufferedInput> input);

/// Creates reader base from buffered input.
/// It is kept here for backward compatibility with Meta's internal usage.
ReaderBase(
memory::MemoryPool& pool,
std::unique_ptr<dwio::common::BufferedInput> input,
dwio::common::FileFormat fileFormat);

/// Creates reader base from metadata.
ReaderBase(
memory::MemoryPool& pool,
Expand Down Expand Up @@ -245,6 +252,14 @@ class ReaderBase {
uint32_t index = 0,
bool fileColumnNamesReadAsLowerCase = false);

static dwio::common::ReaderOptions createReaderOptions(
memory::MemoryPool& pool,
dwio::common::FileFormat fileFormat) {
dwio::common::ReaderOptions options(&pool);
options.setFileFormat(fileFormat);
return options;
}

const dwio::common::ReaderOptions options_;
std::unique_ptr<google::protobuf::Arena> arena_;
std::unique_ptr<PostScript> postScript_;
Expand Down

0 comments on commit 05a1673

Please sign in to comment.