diff --git a/src/Databases/DataLake/RestCatalog.cpp b/src/Databases/DataLake/RestCatalog.cpp index fb7031e3d052..ed539f3a6f54 100644 --- a/src/Databases/DataLake/RestCatalog.cpp +++ b/src/Databases/DataLake/RestCatalog.cpp @@ -811,6 +811,13 @@ void RestCatalog::getNamespacesRecursive( { chassert(current_namespace.starts_with(base_namespace)); + /// Protection from subnamepsaces with empty names + if (current_namespace == base_namespace) + { + LOG_WARNING(log, "Namespace {} has a subnamespace with empty name. This is an error in catalog implementation.", base_namespace); + continue; + } + if (stop_condition && stop_condition(current_namespace)) break;