parameters: (
      breakdown, table: TableWithProperties, query_alias: Literal["prop", "value", None]
  )
return_statement: return f"{expression} AS {query_alias}"
docstring: When querying for breakdown properties:
       * If the breakdown provided is a string, we extract the JSON from the properties object stored in the DB
       * If it is an array of strings, we extract each of those properties and concatenate them into a single value
      clickhouse parameterizes into a query template from a flat list using % string formatting
      values are escaped and inserted in the query here instead of adding new items to the flat list of values
  
      :param query_alias:
  
          Specifies the SQL query alias to add to the expression e.g. `AS prop`. If this is specified as None, then
          no alias will be appended.
docstring_summary: When querying for breakdown properties:
       * If the breakdown provided is a string, we extract the JSON from the properties object stored in the DB
       * If it is an array of strings, we extract each of those properties and concatenate them into a single value
      clickhouse parameterizes into a query template from a flat list using % string formatting
      values are escaped and inserted in the query here instead of adding new items to the flat list of values
docstring_tokens: When querying for breakdown properties : * If the breakdown provided is a string we extract the JSON from the properties object stored in the DB * If it is an array of strings we extract each of those properties and concatenate them into a single value clickhouse parameterizes into a query template from a flat list using % string formatting values are escaped and inserted in the query here instead of adding new items to the flat list of values
function: def get_single_or_multi_property_string_expr(
      breakdown, table: TableWithProperties, query_alias: Literal["prop", "value", None]
  ):
      """
      When querying for breakdown properties:
       * If the breakdown provided is a string, we extract the JSON from the properties object stored in the DB
       * If it is an array of strings, we extract each of those properties and concatenate them into a single value
      clickhouse parameterizes into a query template from a flat list using % string formatting
      values are escaped and inserted in the query here instead of adding new items to the flat list of values
  
      :param query_alias:
  
          Specifies the SQL query alias to add to the expression e.g. `AS prop`. If this is specified as None, then
          no alias will be appended.
  
      """
  
      column = "properties" if table == "events" else "person_props"
  
      if isinstance(breakdown, str) or isinstance(breakdown, int):
          expression, _ = get_property_string_expr(table, str(breakdown), escape_param(breakdown), column)
      else:
          expressions = []
          for b in breakdown:
              expr, _ = get_property_string_expr(table, b, escape_param(b), column)
              expressions.append(expr)
  
          expression = f"array({','.join(expressions)})"
  
      if query_alias is None:
          return expression
  
      return f"{expression} AS {query_alias}"
function_tokens: def get_single_or_multi_property_string_expr ( breakdown , table : TableWithProperties , query_alias : Literal [ "prop" , "value" , None ] ) : column = "properties" if table == "events" else "person_props" if isinstance ( breakdown , str ) or isinstance ( breakdown , int ) : expression , _ = get_property_string_expr ( table , str ( breakdown ) , escape_param ( breakdown ) , column ) else : expressions = [ ] for b in breakdown : expr , _ = get_property_string_expr ( table , b , escape_param ( b ) , column ) expressions . append ( expr ) expression = f"array({','.join(expressions)})" if query_alias is None : return expression return f"{expression} AS {query_alias}"