class_docstr: Renders the SQL query plan assuming ANSI SQL.
class_docstr_tok: ["Renders","the","SQL","query","plan","assuming","ANSI","SQL","."]
docstr: Render a comparison expression like 1 = 2.
docstr_tok: ["Render","a","comparison","expression","like","1","=","2","."]
code: def visit_comparison_expr(
      self, node: SqlComparisonExpression
  ) -> SqlExpressionRenderResult:
      """Render a comparison expression like 1 = 2."""
      combined_params = SqlBindParameters()
  
      left_expr_rendered = self.render_sql_expr(node.left_expr)
      combined_params = combined_params.combine(
          left_expr_rendered.bind_parameters
      )
  
      right_expr_rendered = self.render_sql_expr(node.right_expr)
      combined_params = combined_params.combine(
          right_expr_rendered.bind_parameters
      )
  
      # To avoid issues with operator precedence, use parenthesis to group the left / right expressions if they
      # contain operators.
      return SqlExpressionRenderResult(
          # Render a + b = c
          sql=(
              (
                  f"({left_expr_rendered.sql})"
                  if node.left_expr.requires_parenthesis
                  else left_expr_rendered.sql
              )
              + f" {node.comparison.value} "
              + (
                  f"({right_expr_rendered.sql})"
                  if node.right_expr.requires_parenthesis
                  else right_expr_rendered.sql
              )
          ),
          bind_parameters=combined_params,
      )
  
imports: from __future__ import annotations
  import logging
  import textwrap
  from abc import ABC, abstractmethod
  from collections import namedtuple
  from dataclasses import dataclass
  from typing import Collection, List
  import jinja2
  from dbt_semantic_interfaces.type_enums.date_part import DatePart
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
  from typing_extensions import override
  from metricflow.sql.sql_bind_parameters import SqlBindParameters
  from metricflow.sql.sql_exprs import SqlAggregateFunctionExpression, SqlBetweenExpression, SqlCastToTimestampExpression, SqlColumnAliasReferenceExpression, SqlColumnReferenceExpression, SqlComparisonExpression, SqlDateTruncExpression, SqlExpressionNode, SqlExpressionNodeVisitor, SqlExtractExpression, SqlFunction, SqlGenerateUuidExpression, SqlIsNullExpression, SqlLogicalExpression, SqlNullExpression, SqlPercentileExpression, SqlPercentileFunctionType, SqlRatioComputationExpression, SqlStringExpression, SqlStringLiteralExpression, SqlSubtractTimeIntervalExpression, SqlWindowFunctionExpression
  from metricflow.sql.sql_plan import SqlSelectColumn
label_desc: Use image node_id 7 for calling the DefaultSqlExpressionRenderer obj's underlying member method code with example usage: obj.visit_comparison_expr(node) and returns: SqlExpressionRenderResult