@@ -91,6 +91,7 @@ StorageObjectStorageCluster::StorageObjectStorageCluster(
9191 std::shared_ptr<DataLake::ICatalog> catalog,
9292 bool if_not_exists,
9393 bool is_datalake_query,
94+ bool is_table_function,
9495 bool lazy_init)
9596 : IStorageCluster(
9697 cluster_name_, table_id_, getLogger(fmt::format(" {}({})" , configuration_->getEngineName (), table_id_.table_name)))
@@ -145,6 +146,10 @@ StorageObjectStorageCluster::StorageObjectStorageCluster(
145146 tryLogCurrentException (log_);
146147 }
147148
149+ // For tables need to update configuration on each read
150+ // because data can be changed after previous update
151+ update_configuration_on_read_write = !is_table_function;
152+
148153 ColumnsDescription columns{columns_in_table_or_function_definition};
149154 std::string sample_path;
150155 if (need_resolve_columns_or_format)
@@ -295,6 +300,7 @@ void StorageObjectStorageCluster::updateQueryForDistributedEngineIfNeeded(ASTPtr
295300 {" IcebergS3" , " icebergS3" },
296301 {" IcebergAzure" , " icebergAzure" },
297302 {" IcebergHDFS" , " icebergHDFS" },
303+ {" IcebergLocal" , " icebergLocal" },
298304 {" DeltaLake" , " deltaLake" },
299305 {" DeltaLakeS3" , " deltaLakeS3" },
300306 {" DeltaLakeAzure" , " deltaLakeAzure" },
@@ -416,6 +422,7 @@ void StorageObjectStorageCluster::updateQueryToSendIfNeeded(
416422 {" icebergS3" , " icebergS3Cluster" },
417423 {" icebergAzure" , " icebergAzureCluster" },
418424 {" icebergHDFS" , " icebergHDFSCluster" },
425+ {" icebergLocal" , " icebergLocalCluster" },
419426 {" deltaLake" , " deltaLakeCluster" },
420427 {" deltaLakeS3" , " deltaLakeS3Cluster" },
421428 {" deltaLakeAzure" , " deltaLakeAzureCluster" },
@@ -741,6 +748,18 @@ IDataLakeMetadata * StorageObjectStorageCluster::getExternalMetadata(ContextPtr
741748 return configuration->getExternalMetadata ();
742749}
743750
751+ void StorageObjectStorageCluster::updateConfigurationIfNeeded (ContextPtr context)
752+ {
753+ if (update_configuration_on_read_write)
754+ {
755+ configuration->update (
756+ object_storage,
757+ context,
758+ /* if_not_updated_before */ false ,
759+ /* check_consistent_with_previous_metadata */ false );
760+ }
761+ }
762+
744763void StorageObjectStorageCluster::checkAlterIsPossible (const AlterCommands & commands, ContextPtr context) const
745764{
746765 if (getClusterName (context).empty ())
@@ -905,4 +924,74 @@ bool StorageObjectStorageCluster::prefersLargeBlocks() const
905924 return IStorageCluster::prefersLargeBlocks ();
906925}
907926
927+ bool StorageObjectStorageCluster::supportsPartitionBy () const
928+ {
929+ if (pure_storage)
930+ return pure_storage->supportsPartitionBy ();
931+ return IStorageCluster::supportsPartitionBy ();
932+ }
933+
934+ bool StorageObjectStorageCluster::supportsSubcolumns () const
935+ {
936+ if (pure_storage)
937+ return pure_storage->supportsSubcolumns ();
938+ return IStorageCluster::supportsSubcolumns ();
939+ }
940+
941+ bool StorageObjectStorageCluster::supportsDynamicSubcolumns () const
942+ {
943+ if (pure_storage)
944+ return pure_storage->supportsDynamicSubcolumns ();
945+ return IStorageCluster::supportsDynamicSubcolumns ();
946+ }
947+
948+ bool StorageObjectStorageCluster::supportsTrivialCountOptimization (const StorageSnapshotPtr & snapshot, ContextPtr context) const
949+ {
950+ if (pure_storage)
951+ return pure_storage->supportsTrivialCountOptimization (snapshot, context);
952+ return IStorageCluster::supportsTrivialCountOptimization (snapshot, context);
953+ }
954+
955+ bool StorageObjectStorageCluster::supportsPrewhere () const
956+ {
957+ if (pure_storage)
958+ return pure_storage->supportsPrewhere ();
959+ return IStorageCluster::supportsPrewhere ();
960+ }
961+
962+ bool StorageObjectStorageCluster::canMoveConditionsToPrewhere () const
963+ {
964+ if (pure_storage)
965+ return pure_storage->canMoveConditionsToPrewhere ();
966+ return IStorageCluster::canMoveConditionsToPrewhere ();
967+ }
968+
969+ std::optional<NameSet> StorageObjectStorageCluster::supportedPrewhereColumns () const
970+ {
971+ if (pure_storage)
972+ return pure_storage->supportedPrewhereColumns ();
973+ return IStorageCluster::supportedPrewhereColumns ();
974+ }
975+
976+ IStorageCluster::ColumnSizeByName StorageObjectStorageCluster::getColumnSizes () const
977+ {
978+ if (pure_storage)
979+ return pure_storage->getColumnSizes ();
980+ return IStorageCluster::getColumnSizes ();
981+ }
982+
983+ bool StorageObjectStorageCluster::parallelizeOutputAfterReading (ContextPtr context) const
984+ {
985+ if (pure_storage)
986+ return pure_storage->parallelizeOutputAfterReading (context);
987+ return IStorageCluster::parallelizeOutputAfterReading (context);
988+ }
989+
990+ bool StorageObjectStorageCluster::supportsDelete () const
991+ {
992+ if (pure_storage)
993+ return pure_storage->supportsDelete ();
994+ return IStorageCluster::supportsDelete ();
995+ }
996+
908997}
0 commit comments