code: def replaceQueryVar(where, var_value, var_name):
      if isinstance(where, BinaryOperation):
          replaceQueryVar(where.args[0], var_value, var_name)
          replaceQueryVar(where.args[1], var_value, var_name)
      elif isinstance(where, UnaryOperation):
          replaceQueryVar(where.args[0], var_value, var_name)
      elif isinstance(where, Constant):
          if (
              hasattr(where, "is_var")
              and where.is_var is True
              and where.value == f"$var[{var_name}]"
          ):
              where.value = var_value
  
file_path: mindsdb/mindsdb/api/executor/sql_query/steps/map_reduce_step.py
imports: import copy
  from mindsdb_sql.parser.ast import BinaryOperation, UnaryOperation, Constant
  from mindsdb_sql.planner.steps import MapReduceStep, FetchDataframeStep, MultipleSteps
  from mindsdb.api.executor.sql_query.result_set import ResultSet
  from mindsdb.api.executor.exceptions import LogicError
  from .base import BaseStepCall
  from .fetch_dataframe import FetchDataframeStepCall
label_desc: Use image node_id 3 for calling a global function with example usage: replaceQueryVar(where, var_value, var_name) without return types