mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 05:22:17 +00:00
29 lines
671 B
C++
29 lines
671 B
C++
#pragma once
|
|
|
|
#include <Interpreters/InDepthNodeVisitor.h>
|
|
#include <Interpreters/Aliases.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ASTSelectQuery;
|
|
struct TableWithColumnNamesAndTypes;
|
|
|
|
/** Replaces tuple comparisons with multiple comparisons.
|
|
*
|
|
* Example: SELECT id FROM test_table WHERE (id, value) = (1, 'Value');
|
|
* Result: SELECT id FROM test_table WHERE id = 1 AND value = 'Value';
|
|
*/
|
|
class ComparisonTupleEliminationMatcher
|
|
{
|
|
public:
|
|
struct Data {};
|
|
|
|
static bool needChildVisit(ASTPtr &, const ASTPtr &);
|
|
static void visit(ASTPtr & ast, Data & data);
|
|
};
|
|
|
|
using ComparisonTupleEliminationVisitor = InDepthNodeVisitor<ComparisonTupleEliminationMatcher, true>;
|
|
|
|
}
|