code: def logs_schema_to_athena_schema(log_schema, ddl_statement=True):
      """Convert streamalert log schema to athena schema
  
      Args:
          log_schema (dict): StreamAlert log schema object.
          ddl_statement (bool): Indicate if the Athena table created by Athena
              DDL query or terraform aws_glue_catalog_table resource
  
      Returns:
          athena_schema (dict): Equivalent Athena schema used for generating create table statement
      """
  
      athena_schema = {}
  
      for key_name, key_type in log_schema.items():
          if ddl_statement:
              # Backticks are needed for backward compatibility when creating Athena
              # table via Athena DDL query.
              key_name = "`{}`".format(key_name)
          if key_type == {}:
              # For empty dicts
              athena_schema[key_name] = SCHEMA_TYPE_MAPPING[dict]
          elif key_type == []:
              # For empty array
              athena_schema[key_name] = SCHEMA_TYPE_MAPPING[list]
          elif isinstance(key_type, dict):
              # For recursion
              athena_schema[key_name] = logs_schema_to_athena_schema(
                  key_type, ddl_statement
              )
          else:
              athena_schema[key_name] = SCHEMA_TYPE_MAPPING[key_type]
  
      return athena_schema
  
file_path: streamalert/streamalert_cli/athena/helpers.py
imports: import re
  from streamalert.shared.artifact_extractor import Artifact
  from streamalert.shared.firehose import FirehoseClient
  from streamalert.shared.logger import get_logger
  from streamalert.shared.alert import Alert
  from streamalert_cli.helpers import record_to_schema
label_desc: Use image node_id 2 for calling a global function with example usage: logs_schema_to_athena_schema(log_schema, ddl_statement) and returns: athena_schema