#pragma once #include #include #include namespace DB { class WriteBuffer; struct CollectAliases; struct CollectTables; /** For every ARRAY JOIN, collect a map: * result alias -> source * * There could be several variants: * * SELECT elem FROM t ARRAY JOIN array AS elem elem -> array * SELECT n.elem FROM t ARRAY JOIN nested AS n n -> nested * SELECT array FROM t ARRAY JOIN array array -> array * SELECT nested.elem FROM t ARRAY JOIN nested nested -> nested * SELECT elem FROM t ARRAY JOIN [1, 2, 3] AS elem elem -> [1, 2, 3] */ struct AnalyzeArrayJoins { void process(const ASTPtr & ast); struct SourceInfo { String column_name; ASTPtr node; }; using ResultToSource = std::unordered_map; using ArrayJoins = std::vector; /// Debug output void dump(WriteBuffer & out) const; }; }