Skip to content

Commit

Permalink
Fix compile failure
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed May 27, 2024
1 parent 4e810dd commit fece87c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cpp/velox/operators/writer/VeloxParquetDatasource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace {
const int32_t kGzipWindowBits4k = 12;
}

void initSink(const std::unordered_map<std::string, std::string>& /** sparkConfs */) {
void VeloxParquetDatasource::initSink(const std::unordered_map<std::string, std::string>& /* sparkConfs */) {
if (strncmp(filePath_.c_str(), "file:", 5) == 0) {
sink_ = dwio::common::FileSink::create(filePath_, {.pool = pool_.get()});
} else {
Expand Down
4 changes: 2 additions & 2 deletions cpp/velox/operators/writer/VeloxParquetDatasource.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class VeloxParquetDatasource : public Datasource {
std::shared_ptr<arrow::Schema> schema)
: Datasource(filePath, schema), filePath_(filePath), schema_(schema), pool_(std::move(veloxPool)) {}

void init(const std::unordered_map<std::string, std::string>& sparkConfs);
void initSink(const std::unordered_map<std::string, std::string>& sparkConfs) override;
void init(const std::unordered_map<std::string, std::string>& sparkConfs) override;
virtual void initSink(const std::unordered_map<std::string, std::string>& sparkConfs);
void inspectSchema(struct ArrowSchema* out) override;
void write(const std::shared_ptr<ColumnarBatch>& cb) override;
void close() override;
Expand Down
1 change: 1 addition & 0 deletions cpp/velox/operators/writer/VeloxParquetDatasourceABFS.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class VeloxParquetDatasourceABFS final : public VeloxParquetDatasource {
std::shared_ptr<facebook::velox::memory::MemoryPool> sinkPool,
std::shared_ptr<arrow::Schema> schema)
: VeloxParquetDatasource(filePath, veloxPool, sinkPool, schema) {}

void initSink(const std::unordered_map<std::string, std::string>& sparkConfs) override {
auto hiveConf = getHiveConfig(std::make_shared<facebook::velox::core::MemConfig>(sparkConfs));
auto fileSystem = filesystems::getFileSystem(filePath_, hiveConf);
Expand Down
3 changes: 2 additions & 1 deletion cpp/velox/operators/writer/VeloxParquetDatasourceGCS.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class VeloxParquetDatasourceGCS final : public VeloxParquetDatasource {
std::shared_ptr<facebook::velox::memory::MemoryPool> sinkPool,
std::shared_ptr<arrow::Schema> schema)
: VeloxParquetDatasource(filePath, veloxPool, sinkPool, schema) {}
void initSink(const std::unordered_map<std::string, std::string>& /** sparkConfs*/) override {

void initSink(const std::unordered_map<std::string, std::string>& /* sparkConfs */) override {
auto fileSystem = filesystems::getFileSystem(filePath_, nullptr);
auto* gcsFileSystem = dynamic_cast<filesystems::GCSFileSystem*>(fileSystem.get());
sink_ = std::make_unique<dwio::common::WriteFileSink>(
Expand Down
1 change: 1 addition & 0 deletions cpp/velox/operators/writer/VeloxParquetDatasourceHDFS.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class VeloxParquetDatasourceHDFS final : public VeloxParquetDatasource {
std::shared_ptr<facebook::velox::memory::MemoryPool> sinkPool,
std::shared_ptr<arrow::Schema> schema)
: VeloxParquetDatasource(filePath, veloxPool, sinkPool, schema) {}

void initSink(const std::unordered_map<std::string, std::string>& sparkConfs) override {
auto hiveConf = getHiveConfig(std::make_shared<facebook::velox::core::MemConfig>(sparkConfs));
sink_ = dwio::common::FileSink::create(filePath_, {.connectorProperties = hiveConf, .pool = sinkPool_.get()});
Expand Down
4 changes: 2 additions & 2 deletions cpp/velox/operators/writer/VeloxParquetDatasourceS3.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class VeloxParquetDatasourceS3 final : public VeloxParquetDatasource {
std::shared_ptr<facebook::velox::memory::MemoryPool> sinkPool,
std::shared_ptr<arrow::Schema> schema)
: VeloxParquetDatasource(filePath, veloxPool, sinkPool, schema) {}
void init(const std::unordered_map<std::string, std::string>& sparkConfs) override {

void initSink(const std::unordered_map<std::string, std::string>& sparkConfs) override {
auto hiveConf = getHiveConfig(std::make_shared<facebook::velox::core::MemConfig>(sparkConfs));
sink_ = dwio::common::FileSink::create(filePath_, {.connectorProperties = hiveConf, .pool = sinkPool_.get()});
VeloxParquetDatasource::init(sparkConfs);
}
};
} // namespace gluten

0 comments on commit fece87c

Please sign in to comment.