| 61 | |
| 62 | template <typename Definition, typename Configuration, bool is_data_lake> |
| 63 | StorageObjectStorageConfigurationPtr TableFunctionObjectStorage<Definition, Configuration, is_data_lake>::getConfiguration(ContextPtr context) const |
| 64 | { |
| 65 | if (!configuration) |
| 66 | { |
| 67 | if constexpr (is_data_lake) |
| 68 | { |
| 69 | const auto disk_name = settings && (*settings)[DataLakeStorageSetting::disk].changed |
| 70 | ? (*settings)[DataLakeStorageSetting::disk].value |
| 71 | : ""; |
| 72 | if (!disk_name.empty()) |
| 73 | { |
| 74 | auto disk = context->getDisk(disk_name); |
| 75 | switch (disk->getObjectStorage()->getType()) |
| 76 | { |
| 77 | #if USE_AWS_S3 && USE_AVRO |
| 78 | case ObjectStorageType::S3: |
| 79 | if (Definition::object_storage_type != "s3") |
| 80 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Disk type doesn't match with table engine type storage"); |
| 81 | |
| 82 | if (std::string_view(Definition::name).starts_with("iceberg")) |
| 83 | configuration = std::make_shared<StorageS3IcebergConfiguration>(settings); |
| 84 | #if USE_PARQUET |
| 85 | else |
| 86 | configuration = std::make_shared<StorageS3DeltaLakeConfiguration>(settings); |
| 87 | #endif |
| 88 | break; |
| 89 | #endif |
| 90 | #if USE_AZURE_BLOB_STORAGE && USE_AVRO |
| 91 | case ObjectStorageType::Azure: |
| 92 | if (Definition::name != "iceberg" && |
| 93 | Definition::name != "icebergCluster" && |
| 94 | Definition::name != "deltaLake" && |
| 95 | Definition::name != "deltaLakeCluster" && |
| 96 | Definition::object_storage_type != "azure") |
| 97 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Disk type doesn't match with table engine type storage"); |
| 98 | |
| 99 | if (std::string_view(Definition::name).starts_with("iceberg")) |
| 100 | configuration = std::make_shared<StorageAzureIcebergConfiguration>(settings); |
| 101 | #if USE_PARQUET |
| 102 | else |
| 103 | configuration = std::make_shared<StorageAzureDeltaLakeConfiguration>(settings); |
| 104 | #endif |
| 105 | break; |
| 106 | #endif |
| 107 | #if USE_AVRO |
| 108 | case ObjectStorageType::Local: |
| 109 | if (Definition::name != "iceberg" && |
| 110 | Definition::name != "icebergCluster" && |
| 111 | Definition::name != "deltaLake" && |
| 112 | Definition::name != "deltaLakeCluster" && |
| 113 | Definition::object_storage_type != "local") |
| 114 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Disk type doesn't match with table engine type storage"); |
| 115 | if (std::string_view(Definition::name).starts_with("iceberg")) |
| 116 | configuration = std::make_shared<StorageLocalIcebergConfiguration>(settings); |
| 117 | #if USE_PARQUET |
| 118 | else |
| 119 | configuration = std::make_shared<StorageLocalDeltaLakeConfiguration>(settings); |
| 120 | #endif |
nothing calls this directly
no test coverage detected