class_docstr: Renders an SQL plan following ANSI SQL.
class_docstr_tok: ["Renders","an","SQL","plan","following","ANSI","SQL","."]
code: def visit_select_statement_node(
      self, node: SqlSelectStatementNode
  ) -> SqlPlanRenderResult:  # noqa: D
      # Keep track of all execution parameters for all expressions
      combined_params = SqlBindParameters()
  
      # Render description section
      description_section = "\n".join(
          [f"-- {x}" for x in node.description.split("\n")]
      )
  
      # Render "SELECT" column section
      (
          select_section,
          select_params,
      ) = self._render_select_columns_section(
          node.select_columns, len(node.parent_nodes), node.distinct
      )
      combined_params = combined_params.combine(select_params)
  
      # Render "FROM" section
      from_section, from_params = self._render_from_section(
          node.from_source, node.from_source_alias
      )
      combined_params = combined_params.combine(from_params)
  
      # Render "JOIN" section
      join_section, join_params = self._render_joins_section(
          node.join_descs
      )
      combined_params = combined_params.combine(join_params)
  
      # Render "GROUP BY" section
      group_by_section, group_by_params = self._render_group_by_section(
          node.group_bys
      )
      combined_params = combined_params.combine(group_by_params)
  
      # Render "WHERE" section
      where_section = None
      if node.where:
          where_render_result = self.EXPR_RENDERER.render_sql_expr(
              node.where
          )
          combined_params = combined_params.combine(
              where_render_result.bind_parameters
          )
          where_section = f"WHERE {where_render_result.sql}"
  
      # Render "ORDER BY" section
      order_by_section = None
      if node.order_bys:
          order_by_items: List[str] = []
          for order_by in node.order_bys:
              order_by_render_result = (
                  self.EXPR_RENDERER.render_sql_expr(order_by.expr)
              )
              order_by_items.append(
                  order_by_render_result.sql
                  + (" DESC" if order_by.desc else "")
              )
              combined_params = combined_params.combine(
                  order_by_render_result.bind_parameters
              )
  
          order_by_section = "ORDER BY " + ", ".join(order_by_items)
  
      # Render "LIMIT" section
      limit_section = None
      if node.limit:
          limit_section = f"LIMIT {node.limit}"
  
      # Combine the sections into a single string.
      sections_to_render = []
  
      if description_section:
          sections_to_render.append(description_section)
  
      sections_to_render.append(select_section)
      sections_to_render.append(from_section)
  
      if join_section:
          sections_to_render.append(join_section)
  
      if where_section:
          sections_to_render.append(where_section)
  
      if group_by_section:
          sections_to_render.append(group_by_section)
  
      if order_by_section:
          sections_to_render.append(order_by_section)
  
      if limit_section:
          sections_to_render.append(limit_section)
  
      return SqlPlanRenderResult(
          sql="\n".join(sections_to_render),
          bind_parameters=combined_params,
      )
  
imports: from __future__ import annotations
  import logging
  import textwrap
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import List, Optional, Sequence, Tuple
  from metricflow.sql.render.expr_renderer import DefaultSqlExpressionRenderer, SqlExpressionRenderer, SqlExpressionRenderResult
  from metricflow.sql.sql_bind_parameters import SqlBindParameters
  from metricflow.sql.sql_plan import SqlJoinDescription, SqlQueryPlan, SqlQueryPlanNode, SqlQueryPlanNodeVisitor, SqlSelectColumn, SqlSelectQueryFromClauseNode, SqlSelectStatementNode, SqlTableFromClauseNode
label_desc: Use image node_id 5 for calling the DefaultSqlQueryPlanRenderer obj's underlying member method code with example usage: obj.visit_select_statement_node(node) and returns: SqlPlanRenderResult