ClickHouse/src/Interpreters/RewriteFunctionToSubcolumnVisitor.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
678 B
C++
Raw Normal View History

2021-05-21 18:48:19 +00:00
#pragma once
#include <Interpreters/InDepthNodeVisitor.h>
2021-05-21 23:22:22 +00:00
#include <Storages/StorageInMemoryMetadata.h>
2021-05-21 18:48:19 +00:00
namespace DB
{
class ASTFunction;
2021-05-21 18:48:19 +00:00
/// 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;
2021-05-24 12:57:03 +00:00
void visit(ASTFunction & function, ASTPtr & ast) const;
2021-05-21 18:48:19 +00:00
2021-05-21 23:22:22 +00:00
StorageMetadataPtr metadata_snapshot;
2021-05-21 18:48:19 +00:00
};
using RewriteFunctionToSubcolumnMatcher = OneTypeMatcher<RewriteFunctionToSubcolumnData>;
using RewriteFunctionToSubcolumnVisitor = InDepthNodeVisitor<RewriteFunctionToSubcolumnMatcher, true>;
}