-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Register write filesink for abfs connector
- Loading branch information
1 parent
9e418b1
commit 6e475e2
Showing
8 changed files
with
108 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,14 +20,17 @@ | |
#include <random> | ||
|
||
#include "velox/common/base/tests/GTestUtils.h" | ||
#include "velox/common/config/Config.h" | ||
#include "velox/common/file/File.h" | ||
#include "velox/common/file/FileSystems.h" | ||
#include "velox/connectors/hive/FileHandle.h" | ||
#include "velox/connectors/hive/storage_adapters/abfs/AbfsConfig.h" | ||
#include "velox/connectors/hive/storage_adapters/abfs/AbfsFileSystem.h" | ||
#include "velox/connectors/hive/storage_adapters/abfs/AbfsReadFile.h" | ||
#include "velox/connectors/hive/storage_adapters/abfs/AbfsWriteFile.h" | ||
#include "velox/connectors/hive/storage_adapters/abfs/tests/AzuriteServer.h" | ||
#include "velox/connectors/hive/storage_adapters/abfs/tests/MockDataLakeFileClient.h" | ||
#include "velox/dwio/common/FileSink.h" | ||
#include "velox/exec/tests/utils/PortUtil.h" | ||
#include "velox/exec/tests/utils/TempFilePath.h" | ||
|
||
|
@@ -264,3 +267,23 @@ TEST_F(AbfsFileSystemTest, credNotFOund) { | |
abfs_->openFileForRead(abfsFile), | ||
"Config fs.azure.account.key.test1.dfs.core.windows.net not found"); | ||
} | ||
|
||
TEST_F(AbfsFileSystemTest, registerAbfsFileSink) { | ||
static const std::vector<std::string> paths = { | ||
"abfs://[email protected]/test", | ||
"abfss://[email protected]/test"}; | ||
std::unordered_map<std::string, std::string> config( | ||
{{"fs.azure.account.key.test.dfs.core.windows.net", "NDU2"}}); | ||
auto hiveConfig = | ||
std::make_shared<const config::ConfigBase>(std::move(config)); | ||
for (const auto& path : paths) { | ||
AbfsConfig::registerFakeWriteFileClient( | ||
std::make_unique<MockDataLakeFileClient>()); | ||
auto sink = dwio::common::FileSink::create( | ||
path, {.connectorProperties = hiveConfig}); | ||
auto writeFileSink = dynamic_cast<dwio::common::WriteFileSink*>(sink.get()); | ||
auto writeFile = | ||
dynamic_cast<AbfsWriteFile*>(writeFileSink->toWriteFile().get()); | ||
ASSERT_TRUE(writeFile != nullptr); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters