class_docstr: A StreamAlert Athena Client for creating tables, databases, and executing queries
class_docstr_tok: ["A","StreamAlert","Athena","Client","for","creating","tables",",","databases",",","and","executing","queries"]
docstr: Execute an Athena query on the current database. This operation is non-blocking
  
  See:
      https://docs.aws.amazon.com/cli/latest/reference/athena/start-query-execution.html
  
  Args:
      query (str): SQL query to execute
      options (dict): Configuration options
  
          - database (str): The Athena database to connect to.
  
  Returns:
      str: Athena execution ID for the query that was started
  
  Raises:
      AthenaQueryExecutionError: If any failure occurs during the execution of the
          query, this exception will be raised
docstr_tok: ["Execute","an","Athena","query","on","the","current","database",".","This","operation","is","non-blocking","See",":","https",":","\/\/docs.aws.amazon.com\/cli\/latest\/reference\/athena\/start-query-execution.html","Args",":","query","(","str",")",":","SQL","query","to","execute","options","(","dict",")",":","Configuration","options","-","database","(","str",")",":","The","Athena","database","to","connect","to",".","Returns",":","str",":","Athena","execution","ID","for","the","query","that","was","started","Raises",":","AthenaQueryExecutionError",":","If","any","failure","occurs","during","the","execution","of","the","query",",","this","exception","will","be","raised"]
code: def _execute_query(self, query, options):
      """Execute an Athena query on the current database. This operation is non-blocking
  
      See:
          https://docs.aws.amazon.com/cli/latest/reference/athena/start-query-execution.html
  
      Args:
          query (str): SQL query to execute
          options (dict): Configuration options
  
              - database (str): The Athena database to connect to.
  
      Returns:
          str: Athena execution ID for the query that was started
  
      Raises:
          AthenaQueryExecutionError: If any failure occurs during the execution of the
              query, this exception will be raised
      """
      self._logger.debug("Executing query: %s", query)
      try:
          output_location = "s3://{bucket}/{key}.csv".format(
              bucket=self._s3_results_bucket, key=uuid.uuid4()
          )
          result = self._client.start_query_execution(
              QueryString=query,
              QueryExecutionContext={
                  "Database": options.get("database", self._database)
              },
              ResultConfiguration={"OutputLocation": output_location},
          )
          query_execution_id = result["QueryExecutionId"]
          self._logger.debug(
              "Query dispatched. ID returned: %s", query_execution_id
          )
  
          return query_execution_id
      except ClientError as err:
          raise AthenaQueryExecutionError(
              "Athena query failed:\n{}".format(err)
          )
  
imports: import json
  import uuid
  from botocore.exceptions import ClientError
label_desc: Use image node_id 2 for calling the AthenaClient obj's underlying member method code with example usage: obj._execute_query(query, options) and returns: query_execution_id