-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sessionTimezone and adjustTimestampToTimezone to DWRF reader and writer options #10895
Conversation
✅ Deploy Preview for meta-velox canceled.
|
d8e0416
to
bb946f5
Compare
e9ff5b5
to
331b771
Compare
9d732ac
to
e0e82bd
Compare
@Yuhta The new commit resolves the conflict with the main branch. Please review it again if necessary. |
@wypb Would you rebase this PR so we can merge it? |
f7dda0a
to
b356a66
Compare
@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@mbasmanova I have synced the latest code, thanks. |
566dba1
to
fe628ec
Compare
@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@wypb Can you rebase to the latest main so we can merge it? |
Hi @Yuhta I have synced the latest code. |
04a1e1f
to
029a035
Compare
velox/dwio/dwrf/reader/ReaderBase.h
Outdated
|
||
/// Creates reader base from metadata. | ||
ReaderBase( | ||
memory::MemoryPool& pool, | ||
const dwio::common::ReaderOptions& options, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This signature is used in other integration inside Meta so cannot be changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
65e360e
to
2813162
Compare
@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
memory::MemoryPool& pool, | ||
std::unique_ptr<dwio::common::BufferedInput> input, | ||
dwio::common::FileFormat fileFormat); | ||
const dwio::common::ReaderOptions& options, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wypb We also need another one for ReaderBase(memory::MemoryPool&, std::unique_ptr<dwio::common::BufferedInput>)
(and possibly the following default arguments, but let's create this one first)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Yuhta I have rolled back this part of the code. Please help me review it, thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are missing one for
ReaderBase(
memory::MemoryPool& pool,
std::unique_ptr<dwio::common::BufferedInput> input)
Could be just adding a default argument for fileFormat
in the signature below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Yuhta Sorry, I misunderstood, I have already given a default value to the fileFormat
parameter. Please help me review it, thank you.
05a1673
to
4112cf3
Compare
@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1621915
to
483d36e
Compare
@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wypb thanks for change % nits.
velox/connectors/Connector.h
Outdated
/// Whether to adjust Timestamp to the timeZone obtained through | ||
/// sessionTimezone(). This is used to be compatible with the | ||
/// old logic of Presto. | ||
const bool adjustTimestampToTimezone() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop const
velox/connectors/Connector.h
Outdated
@@ -378,6 +387,7 @@ class ConnectorQueryCtx { | |||
const int driverId_; | |||
const std::string planNodeId_; | |||
const std::string sessionTimezone_; | |||
bool adjustTimestampToTimezone_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add const here
@@ -744,6 +744,13 @@ uint32_t HiveDataSink::appendWriter(const HiveWriterId& id) { | |||
connectorSessionProperties, | |||
options); | |||
|
|||
const auto& sessionTzName = connectorQueryCtx_->sessionTimezone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/sessionTzName/sessionTimeZoneName/
velox/dwio/dwrf/reader/ReaderBase.h
Outdated
return options; | ||
} | ||
|
||
const dwio::common::ReaderOptions options_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move const member first? Thanks!
@@ -103,6 +103,18 @@ class StripeStreams { | |||
*/ | |||
virtual const dwio::common::ColumnSelector& getColumnSelector() const = 0; | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use /// for comments to be consistent with other code places? Thanks!
33f25c4
to
37146b6
Compare
Hi @xiaoxmeng Addressed all the comments, can you help review again? Thanks! |
@wypb There are some build errors |
5735935
to
14dda78
Compare
14dda78
to
11541d0
Compare
@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
…writer options (facebookincubator#10895) Summary: As suggested [here](facebookincubator#10372 (review)) This PR refactors the DRWF Reader and Writer related APIs so that we can get `sessionTimezone` and `adjustTimestampToTimezone` in DRWF's ColumnWriter and ColumnReader. No functionality change. Pull Request resolved: facebookincubator#10895 Reviewed By: xiaoxmeng Differential Revision: D62375865 Pulled By: Yuhta fbshipit-source-id: e4f2f7e0383179aff0e87012f04f07d3119b2d32
As suggested here This PR refactors the DRWF Reader and Writer related APIs so that we can get
sessionTimezone
andadjustTimestampToTimezone
in DRWF's ColumnWriter and ColumnReader. No functionality change.