v.19.14Improvement

Move Collectusedcolumns from Expressionanalyzer to Syntaxanalyzer

Move collectUsedColumns from ExpressionAnalyzer to SyntaxAnalyzer. SyntaxAnalyzer makes required_source_columns itself now. #6416 (Artem Zuikov)
Refactor the column usage analysis in query parsing by moving the collectUsedColumns function from ExpressionAnalyzer to SyntaxAnalyzer, allowing SyntaxAnalyzer to generate the required_source_columns internally.

Why it matters

This change improves the internal architecture of ClickHouse's query analysis by centralizing the determination of required source columns within SyntaxAnalyzer. It simplifies the codebase, possibly enhancing maintainability and consistency in column tracking during query processing.

How to use it

No user-facing changes are required. This is an internal refactor; users will benefit from improved query analysis transparency and performance without needing to modify their queries or settings.