Skip to content

Commit 11ce2f0

Browse files
Enmkianton-ru
authored andcommitted
Merge pull request #761 from Altinity/feature/fix_integration_tests
Feature/fix integration tests
1 parent 18be764 commit 11ce2f0

File tree

6 files changed

+89
-92
lines changed

6 files changed

+89
-92
lines changed

src/Storages/ObjectStorage/DataLakes/DataLakeConfiguration.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
280280
std::string getEngineName() const override { return getImpl().getEngineName(); }
281281
std::string getNamespaceType() const override { return getImpl().getNamespaceType(); }
282282

283+
Path getFullPath() const override { return getImpl().getFullPath(); }
283284
Path getPath() const override { return getImpl().getPath(); }
284285
void setPath(const Path & path) override { getImpl().setPath(path); }
285286

@@ -296,9 +297,14 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
296297
ASTs & args, const String & structure_, const String & format_, ContextPtr context, bool with_structure) override
297298
{ getImpl().addStructureAndFormatToArgsIfNeeded(args, structure_, format_, context, with_structure); }
298299

300+
bool withPartitionWildcard() const override { return getImpl().withPartitionWildcard(); }
301+
bool withGlobsIgnorePartitionWildcard() const override { return getImpl().withGlobsIgnorePartitionWildcard(); }
302+
bool isPathWithGlobs() const override { return getImpl().isPathWithGlobs(); }
303+
bool isNamespaceWithGlobs() const override { return getImpl().isNamespaceWithGlobs(); }
299304
std::string getPathWithoutGlobs() const override { return getImpl().getPathWithoutGlobs(); }
300305

301306
bool isArchive() const override { return getImpl().isArchive(); }
307+
bool isPathInArchiveWithGlobs() const override { return getImpl().isPathInArchiveWithGlobs(); }
302308
std::string getPathInArchive() const override { return getImpl().getPathInArchive(); }
303309

304310
void check(ContextPtr context) const override { getImpl().check(context); }
@@ -340,8 +346,19 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
340346
std::optional<ColumnsDescription> tryGetTableStructureFromMetadata() const override
341347
{ return getImpl().tryGetTableStructureFromMetadata(); }
342348

349+
bool supportsFileIterator() const override { return getImpl().supportsFileIterator(); }
350+
ObjectIterator iterate(
351+
const ActionsDAG * filter_dag,
352+
std::function<void(FileProgress)> callback,
353+
size_t list_batch_size) override
354+
{
355+
return getImpl().iterate(filter_dag, callback, list_batch_size);
356+
}
357+
343358
void update(ObjectStoragePtr object_storage, ContextPtr local_context) override
344359
{ return getImpl().update(object_storage, local_context); }
360+
void updateIfRequired(ObjectStoragePtr object_storage, ContextPtr local_context) override
361+
{ return getImpl().updateIfRequired(object_storage, local_context); }
345362

346363
void initialize(
347364
ASTs & engine_args,
@@ -366,7 +383,6 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
366383
void setCompressionMethod(const String & compression_method_) override { getImpl().setCompressionMethod(compression_method_); }
367384
void setStructure(const String & structure_) override { getImpl().setStructure(structure_); }
368385

369-
protected:
370386
void fromNamedCollection(const NamedCollection & collection, ContextPtr context) override
371387
{ return getImpl().fromNamedCollection(collection, context); }
372388
void fromAST(ASTs & args, ContextPtr context, bool with_structure) override
@@ -449,6 +465,8 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
449465
createDynamicStorage(type);
450466
}
451467

468+
virtual void assertInitialized() const override { return getImpl().assertInitialized(); }
469+
452470
private:
453471
inline StorageObjectStorage::Configuration & getImpl() const
454472
{

src/Storages/ObjectStorage/StorageObjectStorage.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,15 @@ class StorageObjectStorage::Configuration
203203
virtual void addStructureAndFormatToArgsIfNeeded(
204204
ASTs & args, const String & structure_, const String & format_, ContextPtr context, bool with_structure) = 0;
205205

206-
bool withPartitionWildcard() const;
206+
virtual bool withPartitionWildcard() const;
207207
bool withGlobs() const { return isPathWithGlobs() || isNamespaceWithGlobs(); }
208-
bool withGlobsIgnorePartitionWildcard() const;
209-
bool isPathWithGlobs() const;
210-
bool isNamespaceWithGlobs() const;
208+
virtual bool withGlobsIgnorePartitionWildcard() const;
209+
virtual bool isPathWithGlobs() const;
210+
virtual bool isNamespaceWithGlobs() const;
211211
virtual std::string getPathWithoutGlobs() const;
212212

213213
virtual bool isArchive() const { return false; }
214-
bool isPathInArchiveWithGlobs() const;
214+
virtual bool isPathInArchiveWithGlobs() const;
215215
virtual std::string getPathInArchive() const;
216216

217217
virtual void check(ContextPtr context) const;
@@ -256,7 +256,7 @@ class StorageObjectStorage::Configuration
256256
}
257257

258258
virtual void update(ObjectStoragePtr object_storage, ContextPtr local_context);
259-
void updateIfRequired(ObjectStoragePtr object_storage, ContextPtr local_context);
259+
virtual void updateIfRequired(ObjectStoragePtr object_storage, ContextPtr local_context);
260260

261261
const StorageObjectStorageSettings & getSettingsRef() const;
262262

@@ -272,7 +272,7 @@ class StorageObjectStorage::Configuration
272272
virtual ObjectStorageType extractDynamicStorageType(ASTs & /* args */, ContextPtr /* context */, ASTPtr * /* type_arg */ = nullptr) const
273273
{ return ObjectStorageType::None; }
274274

275-
void assertInitialized() const;
275+
virtual void assertInitialized() const;
276276

277277
virtual const String & getFormat() const { return format; }
278278
virtual const String & getCompressionMethod() const { return compression_method; }

src/Storages/ObjectStorage/StorageObjectStorageCluster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ void StorageObjectStorageCluster::updateQueryToSendIfNeeded(
304304
{"s3", "s3Cluster"},
305305
{"azureBlobStorage", "azureBlobStorageCluster"},
306306
{"hdfs", "hdfsCluster"},
307-
{"iceberg", "icebergS3Cluster"},
307+
{"iceberg", "icebergCluster"},
308308
{"icebergS3", "icebergS3Cluster"},
309309
{"icebergAzure", "icebergAzureCluster"},
310310
{"icebergHDFS", "icebergHDFSCluster"},

src/Storages/ObjectStorage/StorageObjectStorageCluster.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ class StorageObjectStorageCluster : public IStorageCluster
6868

6969
void addInferredEngineArgsToCreateQuery(ASTs & args, const ContextPtr & context) const override;
7070

71+
std::optional<UInt64> totalRows(ContextPtr query_context) const override
72+
{
73+
if (pure_storage)
74+
return pure_storage->totalRows(query_context);
75+
configuration->update(object_storage, query_context);
76+
return configuration->totalRows();
77+
}
78+
79+
std::optional<UInt64> totalBytes(ContextPtr query_context) const override
80+
{
81+
if (pure_storage)
82+
return pure_storage->totalBytes(query_context);
83+
configuration->update(object_storage, query_context);
84+
return configuration->totalBytes();
85+
}
86+
7187
private:
7288
void updateQueryToSendIfNeeded(
7389
ASTPtr & query,

0 commit comments

Comments
 (0)