title: How to query on AWS Athena partitioned table 2
body: <p><strong>Summary of the Question</strong></p>
  <p>I also checked the below link to repair my issue, but it doesn't helped me.</p>
  <p><a href="https://stackoverflow.com/questions/64219415/how-to-query-on-aws-athena-partitioned-table">How to query on AWS Athena partitioned table</a></p>
  <p>There are 4 types of partitions, in my log table.</p>
  <ul>
  <li>aws_account_id <code>string</code></li>
  <li>log_type <code>string</code></li>
  <li>aws_region <code>string</code></li>
  <li>date <code>string</code></li>
  </ul>
  <p>I tried a simple <code>SELECT</code> query on partitioned table. But got the below error message.</p>
  <p><strong>ERROR Message</strong></p>
  <pre><code>GENERIC_INTERNAL_ERROR: No value present 
  This query ran against the &quot;default&quot; database, unless qualified by the query.
  </code></pre>
  <p><strong>SELECT Query that I Tried</strong></p>
  <pre><code>SELECT * FROM &quot;logs&quot; LIMIT 10;
  </code></pre>
  <p>AND</p>
  <pre><code>SELECT * FROM &quot;default&quot;.&quot;logs&quot; LIMIT 10;
  </code></pre>
  <p>Since error message about <code>No value present</code>, I checked the partitions results.</p>
  <pre><code>SHOW PARTITIONS logs;
  </code></pre>
  <p><strong>Result format</strong></p>
  <pre><code>aws_account_id=${aws_account_id}/log_type=${log_type}/aws_region=${aws_region}/date=${date}
  </code></pre>
  <p>I would greatly appreciate your help.</p>
  <p><strong>Further Info</strong></p>
  <p><code>CREATE TABLE</code> command that I used</p>
  <p><strong>Create Table</strong></p>
  <pre><code>CREATE EXTERNAL TABLE `logs`(
    `account_id` string, 
    `interface_id` string, 
    `srcaddr` string, 
    `dstaddr` string, 
    `srcport` int, 
    `dstport` int, 
    `traffic_protocol` bigint, 
    `packets` bigint, 
    `bytes` bigint, 
    `start_time` bigint, 
    `end_time` bigint, 
    `traffic_action` string, 
    `log_status` string, 
    `vpc_id` string, 
    `subnet_id` string, 
    `instance_id` string, 
    `tcp_flags` int, 
    `flow_direction` string)
  PARTITIONED BY ( 
    `aws_account_id` string, 
    `log_type` string, 
    `aws_region` string, 
    `date` string)
  ROW FORMAT DELIMITED 
    FIELDS TERMINATED BY ' ' 
  WITH SERDEPROPERTIES ( 
    'EXTERNAL'='true', 
    'skip.header.line.count'='1') 
  STORED AS INPUTFORMAT 
    'org.apache.hadoop.mapred.TextInputFormat' 
  OUTPUTFORMAT 
    'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
  LOCATION
    's3://default/path/'
  TBLPROPERTIES (
    'last_modified_by'='hadoop', 
    'last_modified_time'='1646821386', 
    'projection.aws_account_id.type'='injected', 
    'projection.aws_region.type'='injected', 
    'projection.date.format'='yyyy/MM/dd', 
    'projection.date.interval'='1', 
    'projection.date.interval.unit'='DAYS', 
    'projection.date.range'='2019/11/27, NOW-1DAYS', 
    'projection.date.type'='date', 
    'projection.enabled'='true', 
    'projection.log_type.type'='string', 
    'projection.log_type.values'='logs', 
    'storage.location.template'='s3://default/logs/${aws_account_id}/${log_type}/${aws_region}/${date}', 
    'transient_lastDdlTime'='1646821386')
  </code></pre>