Skip to content

Commit 22b51ec

Browse files
Enmkianton-ru
authored andcommitted
Merge pull request #761 from Altinity/feature/fix_integration_tests
Feature/fix integration tests
1 parent 2de9fd1 commit 22b51ec

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
@@ -290,6 +290,7 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
290290
std::string getEngineName() const override { return getImpl().getEngineName(); }
291291
std::string getNamespaceType() const override { return getImpl().getNamespaceType(); }
292292

293+
Path getFullPath() const override { return getImpl().getFullPath(); }
293294
Path getPath() const override { return getImpl().getPath(); }
294295
void setPath(const Path & path) override { getImpl().setPath(path); }
295296

@@ -306,9 +307,14 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
306307
ASTs & args, const String & structure_, const String & format_, ContextPtr context, bool with_structure) override
307308
{ getImpl().addStructureAndFormatToArgsIfNeeded(args, structure_, format_, context, with_structure); }
308309

310+
bool withPartitionWildcard() const override { return getImpl().withPartitionWildcard(); }
311+
bool withGlobsIgnorePartitionWildcard() const override { return getImpl().withGlobsIgnorePartitionWildcard(); }
312+
bool isPathWithGlobs() const override { return getImpl().isPathWithGlobs(); }
313+
bool isNamespaceWithGlobs() const override { return getImpl().isNamespaceWithGlobs(); }
309314
std::string getPathWithoutGlobs() const override { return getImpl().getPathWithoutGlobs(); }
310315

311316
bool isArchive() const override { return getImpl().isArchive(); }
317+
bool isPathInArchiveWithGlobs() const override { return getImpl().isPathInArchiveWithGlobs(); }
312318
std::string getPathInArchive() const override { return getImpl().getPathInArchive(); }
313319

314320
void check(ContextPtr context) const override { getImpl().check(context); }
@@ -350,8 +356,19 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
350356
std::optional<ColumnsDescription> tryGetTableStructureFromMetadata() const override
351357
{ return getImpl().tryGetTableStructureFromMetadata(); }
352358

359+
bool supportsFileIterator() const override { return getImpl().supportsFileIterator(); }
360+
ObjectIterator iterate(
361+
const ActionsDAG * filter_dag,
362+
std::function<void(FileProgress)> callback,
363+
size_t list_batch_size) override
364+
{
365+
return getImpl().iterate(filter_dag, callback, list_batch_size);
366+
}
367+
353368
void update(ObjectStoragePtr object_storage, ContextPtr local_context) override
354369
{ return getImpl().update(object_storage, local_context); }
370+
void updateIfRequired(ObjectStoragePtr object_storage, ContextPtr local_context) override
371+
{ return getImpl().updateIfRequired(object_storage, local_context); }
355372

356373
void initialize(
357374
ASTs & engine_args,
@@ -376,7 +393,6 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
376393
void setCompressionMethod(const String & compression_method_) override { getImpl().setCompressionMethod(compression_method_); }
377394
void setStructure(const String & structure_) override { getImpl().setStructure(structure_); }
378395

379-
protected:
380396
void fromNamedCollection(const NamedCollection & collection, ContextPtr context) override
381397
{ return getImpl().fromNamedCollection(collection, context); }
382398
void fromAST(ASTs & args, ContextPtr context, bool with_structure) override
@@ -464,6 +480,8 @@ class StorageIcebergConfiguration : public StorageObjectStorage::Configuration,
464480
return getImpl().tryGetSamplePathFromMetadata();
465481
}
466482

483+
virtual void assertInitialized() const override { return getImpl().assertInitialized(); }
484+
467485
private:
468486
inline StorageObjectStorage::Configuration & getImpl() const
469487
{

src/Storages/ObjectStorage/StorageObjectStorage.h

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

207-
bool withPartitionWildcard() const;
207+
virtual bool withPartitionWildcard() const;
208208
bool withGlobs() const { return isPathWithGlobs() || isNamespaceWithGlobs(); }
209-
bool withGlobsIgnorePartitionWildcard() const;
210-
bool isPathWithGlobs() const;
211-
bool isNamespaceWithGlobs() const;
209+
virtual bool withGlobsIgnorePartitionWildcard() const;
210+
virtual bool isPathWithGlobs() const;
211+
virtual bool isNamespaceWithGlobs() const;
212212
virtual std::string getPathWithoutGlobs() const;
213213

214214
virtual bool isArchive() const { return false; }
215-
bool isPathInArchiveWithGlobs() const;
215+
virtual bool isPathInArchiveWithGlobs() const;
216216
virtual std::string getPathInArchive() const;
217217

218218
virtual void check(ContextPtr context) const;
@@ -258,7 +258,7 @@ class StorageObjectStorage::Configuration
258258
}
259259

260260
virtual void update(ObjectStoragePtr object_storage, ContextPtr local_context);
261-
void updateIfRequired(ObjectStoragePtr object_storage, ContextPtr local_context);
261+
virtual void updateIfRequired(ObjectStoragePtr object_storage, ContextPtr local_context);
262262

263263
const StorageObjectStorageSettings & getSettingsRef() const;
264264

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

277-
void assertInitialized() const;
277+
virtual void assertInitialized() const;
278278

279279
virtual const String & getFormat() const { return format; }
280280
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
@@ -307,7 +307,7 @@ void StorageObjectStorageCluster::updateQueryToSendIfNeeded(
307307
{"s3", "s3Cluster"},
308308
{"azureBlobStorage", "azureBlobStorageCluster"},
309309
{"hdfs", "hdfsCluster"},
310-
{"iceberg", "icebergS3Cluster"},
310+
{"iceberg", "icebergCluster"},
311311
{"icebergS3", "icebergS3Cluster"},
312312
{"icebergAzure", "icebergAzureCluster"},
313313
{"icebergHDFS", "icebergHDFSCluster"},

src/Storages/ObjectStorage/StorageObjectStorageCluster.h

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

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

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

0 commit comments

Comments
 (0)