mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 09:22:05 +00:00
b2cfa70541
481 -> 230
26 lines
678 B
C++
26 lines
678 B
C++
#pragma once
|
|
|
|
#include <Interpreters/InDepthNodeVisitor.h>
|
|
#include <Storages/StorageInMemoryMetadata.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ASTFunction;
|
|
|
|
/// Rewrites functions to subcolumns, if possible, to reduce amount of read data.
|
|
/// E.g. 'length(arr)' -> 'arr.size0', 'col IS NULL' -> 'col.null'
|
|
class RewriteFunctionToSubcolumnData
|
|
{
|
|
public:
|
|
using TypeToVisit = ASTFunction;
|
|
void visit(ASTFunction & function, ASTPtr & ast) const;
|
|
|
|
StorageMetadataPtr metadata_snapshot;
|
|
};
|
|
|
|
using RewriteFunctionToSubcolumnMatcher = OneTypeMatcher<RewriteFunctionToSubcolumnData>;
|
|
using RewriteFunctionToSubcolumnVisitor = InDepthNodeVisitor<RewriteFunctionToSubcolumnMatcher, true>;
|
|
|
|
}
|