class_docstr: Handle polling an SQS queue and running Athena queries for updating tables
class_docstr_tok: ["Handle","polling","an","SQS","queue","and","running","Athena","queries","for","updating","tables"]
code: def __init__(self):
      config = load_config(include={"lambda.json", "global.json"})
      prefix = config["global"]["account"]["prefix"]
      athena_config = config["lambda"]["athena_partitioner_config"]
      self._file_format = get_data_file_format(config)
  
      if self._file_format == "parquet":
          self._alerts_regex = self.ALERTS_REGEX_PARQUET
          self._data_regex = self.DATA_REGEX_PARQUET
  
      elif self._file_format == "json":
          self._alerts_regex = self.ALERTS_REGEX
          self._data_regex = self.DATA_REGEX
      else:
          message = (
              'file format "{}" is not supported. Supported file format are '
              '"parquet", "json". Please update the setting in athena_partitioner_config '
              'in "conf/lambda.json"'.format(self._file_format)
          )
          raise ConfigError(message)
  
      self._athena_buckets = athena_partition_buckets(config)
  
      db_name = get_database_name(config)
  
      # Get the S3 bucket to store Athena query results
      results_bucket = athena_config.get(
          "results_bucket",
          "s3://{}-streamalert-athena-results".format(prefix),
      )
  
      self._s3_buckets_and_keys = defaultdict(set)
  
      self._create_client(db_name, results_bucket)
  
imports: from collections import defaultdict
  import json
  import posixpath
  import re
  import urllib.request
  import urllib.parse
  import urllib.error
  from streamalert.shared.utils import get_database_name, get_data_file_format
  from streamalert.shared.athena import AthenaClient
  from streamalert.shared.config import athena_partition_buckets, load_config
  from streamalert.shared.exceptions import ConfigError
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 1 to create a new AthenaPartitioner object  with example: obj = AthenaPartitioner()