class_docstr: Removes unnecessary columns from SELECT statements in the SQL query plan.
  
  As the visitor traverses up to the parents, it pushes the list of required columns and rewrites the parent nodes.
class_docstr_tok: ["Removes","unnecessary","columns","from","SELECT","statements","in","the","SQL","query","plan",".","As","the","visitor","traverses","up","to","the","parents",",","it","pushes","the","list","of","required","columns","and","rewrites","the","parent","nodes","."]
docstr: Returns the expressions used in the immediate select statement.
  
  i.e. this does not return expressions used in sub-queries. pruned_select_columns needs to be passed in since the
  node may have the select columns pruned.
docstr_tok: ["Returns","the","expressions","used","in","the","immediate","select","statement",".","i.e",".","this","does","not","return","expressions","used","in","sub-queries",".","pruned_select_columns","needs","to","be","passed","in","since","the","node","may","have","the","select","columns","pruned","."]
code: def _search_for_expressions(
      self,
      select_node: SqlSelectStatementNode,
      pruned_select_columns: Tuple[SqlSelectColumn, ...],
  ) -> SqlExpressionTreeLineage:
      """Returns the expressions used in the immediate select statement.
  
      i.e. this does not return expressions used in sub-queries. pruned_select_columns needs to be passed in since the
      node may have the select columns pruned.
      """
      all_expr_search_results: List[SqlExpressionTreeLineage] = []
  
      for select_column in pruned_select_columns:
          all_expr_search_results.append(select_column.expr.lineage)
  
      for join_description in select_node.join_descs:
          if join_description.on_condition:
              all_expr_search_results.append(
                  join_description.on_condition.lineage
              )
  
      for group_by in select_node.group_bys:
          all_expr_search_results.append(group_by.expr.lineage)
  
      for order_by in select_node.order_bys:
          all_expr_search_results.append(order_by.expr.lineage)
  
      if select_node.where:
          all_expr_search_results.append(select_node.where.lineage)
  
      return SqlExpressionTreeLineage.combine(all_expr_search_results)
  
file_path: metricflow/metricflow/sql/optimizer/column_pruner.py
imports: from __future__ import annotations
  import logging
  from collections import defaultdict
  from typing import Dict, List, Set, Tuple
  from metricflow.sql.optimizer.sql_query_plan_optimizer import SqlQueryPlanOptimizer
  from metricflow.sql.sql_exprs import SqlExpressionTreeLineage
  from metricflow.sql.sql_plan import SqlJoinDescription, SqlQueryPlanNode, SqlQueryPlanNodeVisitor, SqlSelectColumn, SqlSelectQueryFromClauseNode, SqlSelectStatementNode, SqlTableFromClauseNode
label_desc: Use image node_id 2 for calling the SqlColumnPrunerVisitor obj's underlying member method code with example usage: obj._search_for_expressions(select_node, pruned_select_columns) and returns: SqlExpressionTreeLineage