Repository: ClickHouse/ClickHouse
File: src/TableFunctions/TableFunctionMergeTreeAnalyzeIndexes.cpp (C++)

Code before:
    {}

    std::string getName() const override { return mergeTreeAnalyzeIndexFunctionName(resolve_by_uuid); }

    void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
    ColumnsDescription getActualTableStructure(ContextPtr context, bool is_insert_query) const override;
    std::vector<size_t> skipAnalysisForArguments(const QueryTreeNodePtr & query_node_table_function, ContextPtr context) const override;

private:
    StoragePtr executeImpl(
        const ASTPtr & ast_function,
        ContextPtr context,
        const std::string & table_name,
        ColumnsDescription cached_columns,
        bool is_insert_query) const override;

    const char * getStorageEngineName() const override
    {
        /// Technically it's MergeTreeAnalyzeIndexes but it doesn't register itself
        return "";
    }

    void parseArgumentsUUID(const ASTs & args_func, ContextPtr context);
    void parseArgumentsDatabaseTable(const ASTs & args_func, ContextPtr context);

    /// 2 features will benefit from distributed index load + analysis :
    /// a) vector search with large vector indexes
    /// b) top-k using only minmax index (e.g SELECT * FROM youtube ORDER BY dislike_count LIMIT 10)
    /// These 2 cannot be packaged in the 'predicate'
    void parseArgumentsForOptimizations(const ASTs & args, ContextPtr context);

    const bool resolve_by_uuid;
    StorageID source_table_id{StorageID::createEmpty()};
    String parts_regexp;
    ASTPtr predicate;
    OptionalVectorSearchParameters vector_search_parameters;
};

std::vector<size_t> TableFunctionMergeTreeAnalyzeIndexes::skipAnalysisForArguments(const QueryTreeNodePtr & /* query_node_table_function */, ContextPtr /* context */) const
{
    /// Filter should not be analyzed
    if (resolve_by_uuid)
        return {1};
    else
        return {2};
}

void TableFunctionMergeTreeAnalyzeIndexes::parseArguments(const ASTPtr & ast_function, ContextPtr context)
{
    const ASTs & args_func = ast_function->children;
    if (args_func.size() != 1)

Review comment (suggestion):
```suggestion
    /// 2 features will benefit from distributed index load + analysis:
```

Code after:
    {}

    std::string getName() const override { return mergeTreeAnalyzeIndexFunctionName(resolve_by_uuid); }

    void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
    ColumnsDescription getActualTableStructure(ContextPtr context, bool is_insert_query) const override;
    std::vector<size_t> skipAnalysisForArguments(const QueryTreeNodePtr & query_node_table_function, ContextPtr context) const override;

private:
    StoragePtr executeImpl(
        const ASTPtr & ast_function,
        ContextPtr context,
        const std::string & table_name,
        ColumnsDescription cached_columns,
        bool is_insert_query) const override;

    const char * getStorageEngineName() const override
    {
        /// Technically it's MergeTreeAnalyzeIndexes but it doesn't register itself
        return "";
    }

    void parseArgumentsUUID(const ASTs & args_func, ContextPtr context);
    void parseArgumentsDatabaseTable(const ASTs & args_func, ContextPtr context);

    /// 2 features will benefit from distributed index load + analysis:
    /// a) vector search with large vector indexes
    /// b) top-k using only minmax index (e.g SELECT * FROM youtube ORDER BY dislike_count LIMIT 10)
    /// These 2 cannot be packaged in the 'predicate'
    void parseArgumentsForOptimizations(const ASTs & args, ContextPtr context);

    const bool resolve_by_uuid;
    StorageID source_table_id{StorageID::createEmpty()};
    String parts_regexp;
    ASTPtr predicate;
    OptionalVectorSearchParameters vector_search_parameters;
};

std::vector<size_t> TableFunctionMergeTreeAnalyzeIndexes::skipAnalysisForArguments(const QueryTreeNodePtr & /* query_node_table_function */, ContextPtr /* context */) const
{
    /// Filter should not be analyzed
    if (resolve_by_uuid)
        return {1};
    else
        return {2};
}

void TableFunctionMergeTreeAnalyzeIndexes::parseArguments(const ASTPtr & ast_function, ContextPtr context)
{
    const ASTs & args_func = ast_function->children;
    if (args_func.size() != 1)