class_docstr: Helper class for constructing various join components in a SqlQueryPlan.
docstr: Creates an expression that can go in the ON condition when coalescing join keys with a FULL OUTER JOIN.
  
  e.g.
  
  dimension_specs = ["is_instant", "ds"]
  table_aliases_in_coalesce = ["a", "b"]
  table_alias_on_right_equality = ["c"]
  
  ->
  
  COALESCE(a.is_instant, b.is_instant) = c.is_instant
  AND COALESCE(a.ds, b.ds) = c.ds
  
  This is necessary for cases where 3 or more subqueries will be linked via FULL OUTER JOINs. If that happens,
  the set of join keys from subquery 3 must be compared to the join keys from both subquery 1 and subquery 2,
  otherwise duplicate rows might appear in the output.
  
  For example:
  
  table1: [('a', 10), ('b', 20)]
  table2: [('a', 100), ('c', 200)]
  table3: [('a', 1000), ('c', 2000)]
  
  ->
  
  output without COALESCE: [('a', 10, 100, 1000), ('c', NULL, 200, NULL), ('c', NULL, NULL, 2000)]
  output with COALESCE: [('a', 10, 100, 1000), ('c', NULL, 200, 2000)]
  
  The latter scenario consolidates the rows keyed by 'c' into a single entry.
docstr_tok: ["Creates","an","expression","that","can","go","in","the","ON","condition","when","coalescing","join","keys","with","a","FULL","OUTER","JOIN",".","e.g",".","dimension_specs","=","[","``","is_instant","''",",","``","ds","''","]","table_aliases_in_coalesce","=","[","``","a","''",",","``","b","''","]","table_alias_on_right_equality","=","[","``","c","''","]","-",">","COALESCE","(","a.is_instant",",","b.is_instant",")","=","c.is_instant","AND","COALESCE","(","a.ds",",","b.ds",")","=","c.ds","This","is","necessary","for","cases","where","3","or","more","subqueries","will","be","linked","via","FULL","OUTER","JOINs",".","If","that","happens",",","the","set","of","join","keys","from","subquery","3","must","be","compared","to","the","join","keys","from","both","subquery","1","and","subquery","2",",","otherwise","duplicate","rows","might","appear","in","the","output",".","For","example",":","table1",":","[","(","'","a","'",",","10",")",",","(","'","b","'",",","20",")","]","table2",":","[","(","'","a","'",",","100",")",",","(","'","c","'",",","200",")","]","table3",":","[","(","'","a","'",",","1000",")",",","(","'","c","'",",","2000",")","]","-",">","output","without","COALESCE",":","[","(","'","a","'",",","10",",","100",",","1000",")",",","(","'","c","'",",","NULL",",","200",",","NULL",")",",","(","'","c","'",",","NULL",",","NULL",",","2000",")","]","output","with","COALESCE",":","[","(","'","a","'",",","10",",","100",",","1000",")",",","(","'","c","'",",","NULL",",","200",",","2000",")","]","The","latter","scenario","consolidates","the","rows","keyed","by","'","c","'","into","a","single","entry","."]
code: def _make_equality_expression_for_full_outer_join(
      table_aliases_in_coalesce: Sequence[str],
      right_table_alias: str,
      column_alias: str,
  ) -> SqlExpressionNode:
      """Creates an expression that can go in the ON condition when coalescing join keys with a FULL OUTER JOIN.
  
      e.g.
  
      dimension_specs = ["is_instant", "ds"]
      table_aliases_in_coalesce = ["a", "b"]
      table_alias_on_right_equality = ["c"]
  
      ->
  
      COALESCE(a.is_instant, b.is_instant) = c.is_instant
      AND COALESCE(a.ds, b.ds) = c.ds
  
      This is necessary for cases where 3 or more subqueries will be linked via FULL OUTER JOINs. If that happens,
      the set of join keys from subquery 3 must be compared to the join keys from both subquery 1 and subquery 2,
      otherwise duplicate rows might appear in the output.
  
      For example:
  
      table1: [('a', 10), ('b', 20)]
      table2: [('a', 100), ('c', 200)]
      table3: [('a', 1000), ('c', 2000)]
  
      ->
  
      output without COALESCE: [('a', 10, 100, 1000), ('c', NULL, 200, NULL), ('c', NULL, NULL, 2000)]
      output with COALESCE: [('a', 10, 100, 1000), ('c', NULL, 200, 2000)]
  
      The latter scenario consolidates the rows keyed by 'c' into a single entry.
      """
      return SqlComparisonExpression(
          left_expr=make_coalesced_expr(
              table_aliases_in_coalesce, column_alias
          ),
          comparison=SqlComparison.EQUALS,
          right_expr=SqlColumnReferenceExpression(
              col_ref=SqlColumnReference(
                  table_alias=right_table_alias,
                  column_name=column_alias,
              )
          ),
      )
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import List, Optional, Sequence, Tuple
  from dbt_semantic_interfaces.protocols.metric import MetricTimeWindow
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
  from metricflow.assert_one_arg import assert_exactly_one_arg_set
  from metricflow.dataflow.dataflow_plan import JoinConversionEventsNode, JoinDescription, JoinOverTimeRangeNode, JoinToTimeSpineNode
  from metricflow.dataset.sql_dataset import SqlDataSet
  from metricflow.plan_conversion.sql_expression_builders import make_coalesced_expr
  from metricflow.sql.sql_exprs import SqlColumnReference, SqlColumnReferenceExpression, SqlComparison, SqlComparisonExpression, SqlDateTruncExpression, SqlIsNullExpression, SqlLogicalExpression, SqlLogicalOperator, SqlSubtractTimeIntervalExpression
  from metricflow.sql.sql_plan import SqlExpressionNode, SqlJoinDescription, SqlJoinType, SqlSelectStatementNode
label_desc: Use image node_id 6 for calling the SqlQueryPlanJoinBuilder obj's underlying member method code with example usage: obj._make_equality_expression_for_full_outer_join(table_aliases_in_coalesce, right_table_alias, column_alias) and returns: SqlComparisonExpression