Repository: ClickHouse/ClickHouse
File: src/Storages/ObjectStorage/Utils.cpp (C++)

Code before:
    try
    {
        schema_file = StorageObjectStorage::resolveSchemaFromData(
            object_storage,
            config_ptr,
            *format_settings,
            sample_path_schema,
            context);
    }
    catch (...)
    {
        tryLogCurrentException(log, "while verifying schema consistency", LogsLevel::debug);
    }
    if (schema_file)
    {
        std::unordered_set<String> hive_partitioning_columns;
        for (const auto & column_name : hive_partition_columns_to_read_from_file_path->getNames())
            hive_partitioning_columns.insert(column_name);
        for (const auto & column : *columns_in_table_or_function_definition)
            if (!schema_file->tryGet(column.name) && !hive_partitioning_columns.contains(column.name))
            {
                String hive_columns;
                for (const auto & hive_column : hive_partitioning_columns)
                    hive_columns += hive_column + ";";
                throw Exception(ErrorCodes::BAD_ARGUMENTS, "Cannot find column {} in schema {}, hive columns {}", column.name, schema_file->toString(false), hive_columns);
            }
    }
}

ASTs::iterator getFirstKeyValueArgument(ASTs & args)
{
    ASTs::iterator first_key_value_arg_it = args.end();
    for (auto it = args.begin(); it != args.end(); ++it)
    {
        const auto * function_ast = (*it)->as<ASTFunction>();
        if (function_ast && function_ast->name == "equals")
        {
             if (first_key_value_arg_it == args.end())
                first_key_value_arg_it = it;
        }
        else if (first_key_value_arg_it != args.end())
        {
            throw Exception(
                ErrorCodes::BAD_ARGUMENTS,
                "Expected positional arguments to go before key-value arguments");
        }
    }
    return first_key_value_arg_it;
}

std::unordered_map<std::string, Field> parseKeyValueArguments(const ASTs & function_args, ContextPtr context)

Review comment (suggestion):
```suggestion
                String hive_columns = fmt::join(hive_partitioning_columns, ", ");
```

Code after:

    /// Verify that explicitly specified columns exist in the schema inferred from data.
    String sample_path_schema = *sample_path;
    std::optional<ColumnsDescription> schema_file;
    try
    {
        schema_file = StorageObjectStorage::resolveSchemaFromData(
            object_storage,
            configuration,
            *format_settings,
            sample_path_schema,
            context);
    }
    catch (...)
    {
        tryLogCurrentException(log, "while verifying schema consistency", LogsLevel::debug);
    }
    if (schema_file)
    {
        auto hive_partitioning_columns = hive_partition_columns_to_read_from_file_path->getNameSet();
        for (const auto & column : *columns_in_table_or_function_definition)
            if (!schema_file->tryGet(column.name) && !hive_partitioning_columns.contains(column.name))
            {
                String hive_columns;
                for (const auto & hive_column : hive_partitioning_columns)
                    hive_columns += hive_column + ";";
                throw Exception(ErrorCodes::BAD_ARGUMENTS, "Cannot find column {} in schema {}, hive columns {}", column.name, schema_file->toString(false), hive_columns);
            }
    }
}

ASTs::iterator getFirstKeyValueArgument(ASTs & args)
{
    ASTs::iterator first_key_value_arg_it = args.end();
    for (auto it = args.begin(); it != args.end(); ++it)
    {
        const auto * function_ast = (*it)->as<ASTFunction>();
        if (function_ast && function_ast->name == "equals")
        {
             if (first_key_value_arg_it == args.end())
                first_key_value_arg_it = it;
        }
        else if (first_key_value_arg_it != args.end())
        {
            throw Exception(
                ErrorCodes::BAD_ARGUMENTS,
                "Expected positional arguments to go before key-value arguments");
        }
    }
    return first_key_value_arg_it;
}