-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[native] Refactor TaskManagerTest to not create common::WriterOptions instance #23480
Conversation
@@ -29,6 +29,7 @@ | |||
#include "velox/dwio/common/FileSink.h" | |||
#include "velox/dwio/common/WriterFactory.h" | |||
#include "velox/dwio/common/tests/utils/BatchMaker.h" | |||
#include "velox/dwio/dwrf/writer/Writer.h" |
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.
@kewang1024 Can you please explain why making this change? The TaskManagerTest is file-format orthogonal and should NOT depend on DWRF. We've been trying to remove DWRF dependencies from HiveConnectorTest as well, e.g. facebookincubator/velox#10150
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.
Essentially we want to make common::WriterOptions::processConfigs function pure virtual to make sure every data format will implement its own.
As a result, common::WriterOptions can not be initiated.
cc: @xiaoxmeng
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.
@yingsu00 good point. We might need this change as we disable creation of dwio common writer options as it is an abstract class now. If we want to cover parquet file format here, then we can make this a parameterized test with different file formats. But I guess it is not required for TaskManagerTest.
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.
I think this will break Meta internal test as Velox side change on Writer options is landed.
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.
Do we need this header still?
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.
Please use [native]
prefix for the commit.
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.
I'm removing the "request change" to unblock Meta internal build break for now. We will revisit this issue soon. Since "dwio::common" used to work, I think there may be a better solution than making presto_cpp/main tests depend on DWRF.
f8ce350
to
f611af5
Compare
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.
Approving it for now to unblock Meta workloads
@@ -299,7 +300,8 @@ class TaskManagerTest : public testing::Test { | |||
void writeToFile( | |||
const std::string& filePath, | |||
const std::vector<RowVectorPtr>& vectors) { | |||
auto options = std::make_shared<dwio::common::WriterOptions>(); | |||
std::shared_ptr<dwio::common::WriterOptions> 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.
@kewang1024 @xiaoxmeng Does the following not work?
const std::shared_ptr<dwio::common::WriterFactory> writerFactory_;
In constructor, initialize the writerFactory_ as:
writerFactory_(dwio::common::getWriterFactory(dwio::common::FileFormat::DWRF))
Then in writeToFile:
auto options = writerFactory_->createWriterOptions();
This way we don't need to include "velox/dwio/dwrf/writer/Writer.h" but just the dwio::common ones.
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.
Yeah, I think it works as in the production code. Thanks!
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.
Thanks @yingsu00 for your good suggestion!
493840c
to
1513ddc
Compare
… instance After velox refactoring, we should not create dwio::common::WriterOptions instance anymore. Update TaskManagerTest.cpp
1513ddc
to
509597e
Compare
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.
@kewang1024 thanks!
We want to make common::WriterOptions::processConfigs function pure virtual
to make sure every data format will implement its own.
As a result, we should not create dwio::common::WriterOptions instance anymore