code: def base_select_statement() -> SqlSelectStatementNode:
      """SELECT statement used to build test cases.
  
      -- src3
      SELECT
        SUM(src2.col0) AS bookings
        src2.col1 AS ds
        -- src2
        SELECT
          src1.bookings AS bookings
          , src1.ds AS ds
        FROM (
          -- src1
          SELECT
            1 AS bookings
            , src0.ds AS ds
          FROM demo.fct_bookings src0
          LIMIT 2
        ) src1
        WHERE src1.ds >= "2020-01-01"
        LIMIT 1
      ) src2
      WHERE src2.ds <= "2020-01-05"
      GROUP BY src2.ds
      ORDER BY src2.ds
      """
      return SqlSelectStatementNode(
          description="src3",
          select_columns=(
              SqlSelectColumn(
                  expr=SqlAggregateFunctionExpression(
                      sql_function=SqlFunction.SUM,
                      sql_function_args=[
                          SqlColumnReferenceExpression(
                              col_ref=SqlColumnReference(
                                  table_alias="src2",
                                  column_name="bookings",
                              )
                          )
                      ],
                  ),
                  column_alias="bookings",
              ),
              SqlSelectColumn(
                  expr=SqlColumnReferenceExpression(
                      col_ref=SqlColumnReference(
                          table_alias="src2", column_name="ds"
                      )
                  ),
                  column_alias="ds",
              ),
          ),
          from_source=SqlSelectStatementNode(
              description="src2",
              select_columns=(
                  SqlSelectColumn(
                      expr=SqlColumnReferenceExpression(
                          col_ref=SqlColumnReference(
                              table_alias="src1", column_name="bookings"
                          )
                      ),
                      column_alias="bookings",
                  ),
                  SqlSelectColumn(
                      expr=SqlColumnReferenceExpression(
                          col_ref=SqlColumnReference(
                              table_alias="src1", column_name="ds"
                          )
                      ),
                      column_alias="ds",
                  ),
              ),
              from_source=SqlSelectStatementNode(
                  description="src1",
                  select_columns=(
                      SqlSelectColumn(
                          expr=SqlColumnReferenceExpression(
                              col_ref=SqlColumnReference(
                                  table_alias="src0",
                                  column_name="bookings",
                              )
                          ),
                          column_alias="bookings",
                      ),
                      SqlSelectColumn(
                          expr=SqlColumnReferenceExpression(
                              col_ref=SqlColumnReference(
                                  table_alias="src0",
                                  column_name="ds",
                              )
                          ),
                          column_alias="ds",
                      ),
                  ),
                  from_source=SqlTableFromClauseNode(
                      sql_table=SqlTable(
                          schema_name="demo", table_name="fct_bookings"
                      )
                  ),
                  from_source_alias="src0",
                  joins_descs=(),
                  group_bys=(),
                  order_bys=(),
                  limit=2,
              ),
              from_source_alias="src1",
              joins_descs=(),
              where=SqlComparisonExpression(
                  left_expr=SqlColumnReferenceExpression(
                      SqlColumnReference(
                          table_alias="src1",
                          column_name="ds",
                      )
                  ),
                  comparison=SqlComparison.GREATER_THAN_OR_EQUALS,
                  right_expr=SqlStringLiteralExpression("2020-01-01"),
              ),
              group_bys=(),
              order_bys=(),
              limit=1,
          ),
          from_source_alias="src2",
          joins_descs=(),
          group_bys=(
              SqlSelectColumn(
                  expr=SqlColumnReferenceExpression(
                      SqlColumnReference(
                          table_alias="src2",
                          column_name="ds",
                      )
                  ),
                  column_alias="ds",
              ),
          ),
          where=SqlComparisonExpression(
              left_expr=SqlColumnReferenceExpression(
                  SqlColumnReference(
                      table_alias="src2",
                      column_name="ds",
                  )
              ),
              comparison=SqlComparison.LESS_THAN_OR_EQUALS,
              right_expr=SqlStringLiteralExpression("2020-01-05"),
          ),
          order_bys=(
              SqlOrderByDescription(
                  expr=SqlColumnReferenceExpression(
                      SqlColumnReference(
                          table_alias="src2",
                          column_name="ds",
                      )
                  ),
                  desc=False,
              ),
          ),
          limit=None,
      )
  
imports: from __future__ import annotations
  import pytest
  from _pytest.fixtures import FixtureRequest
  from metricflow.dataflow.sql_table import SqlTable
  from metricflow.sql.optimizer.rewriting_sub_query_reducer import SqlRewritingSubQueryReducer
  from metricflow.sql.sql_exprs import SqlAggregateFunctionExpression, SqlColumnReference, SqlColumnReferenceExpression, SqlComparison, SqlComparisonExpression, SqlFunction, SqlStringExpression, SqlStringLiteralExpression
  from metricflow.sql.sql_plan import SqlJoinDescription, SqlJoinType, SqlOrderByDescription, SqlSelectColumn, SqlSelectStatementNode, SqlTableFromClauseNode
  from metricflow.test.fixtures.setup_fixtures import MetricFlowTestSessionState
  from metricflow.test.sql.compare_sql_plan import assert_default_rendered_sql_equal
label_desc: Use image node_id 1 for calling a global function with example usage: base_select_statement() and returns: SqlSelectStatementNode