title: Creating Hive external table on AWS EMR
body: <p>I am trying to create an external table in <code>hive</code> via <code>hue</code> on <code>AWS EMR</code></p>
  
  <pre><code>CREATE EXTERNAL TABLE IF NOT EXISTS urls (
    id STRING,
    `date` TIMESTAMP,
    url STRING,
    expandedUrl STRING,
    domain STRING
  ) 
  PARTITIONED BY (`year` INT, `month` INT, `day` INT)
  STORED AS PARQUET LOCATION 's3://data/processed/urls/'
  </code></pre>
  
  <ul>
  <li>I have created and <code>EMR</code> cluster (emr-5.4.0) using the AWS console.</li>
  <li>Logged into <code>Hue</code></li>
  <li>Run the above <code>SQL</code></li>
  </ul>
  
  <p>In the Metastore Manager I get the following error:</p>
  
  <blockquote>
    <p>Cannot access: s3://data/processed/urls/. Note:
    you are a Hue admin but not a HDFS superuser, "hdfs" or part of HDFS
    supergroup, "hadoop".</p>
    
    <p>[Errno 22] Unknown scheme s3, available schemes: ['hdfs']</p>
  </blockquote>
  
  <p>I also can't see s3 under the File Manager.
  I can access s3 from the master node using the CLI tools.</p>
  
  <p>Are there any config options I am missing from the cluster creation?
  Do I need to give the Hue user additional permissions?</p>
  
  <p><strong>UPDATE</strong> </p>
  
  <p>I have tried creating an hdfs user and a new database, as franklinsijo suggested.</p>
  
  <p>I now get the same error on the database:</p>
  
  <blockquote>
    <p>Cannot access: s3://data/processed.</p>
    
    <p>[Errno 22] Unknown scheme s3, available schemes: ['hdfs']</p>
  </blockquote>
  
  <p>When the "create database" SQL is run from the hive CLI I get "Access Denied" 
  I am using <code>EMR_DefaultRole</code> which has both <code>AmazonElasticMapReduceRole</code> and <code>AmazonS3FullAccess</code></p>
  
  <p><strong>UPDATE 2</strong> </p>
  
  <p>I have worked through the issue with help from franklinsijo</p>
  
  <ul>
  <li>I can create databases and tables on s3 from both the <code>hive cli</code> and the <code>hue</code>.</li>
  <li>I can read and write data from the tables</li>
  <li>I <strong>can't</strong> see <code>S3 Browser</code> as detailed in <a href="http://gethue.com/introducing-s3-support-in-hue/" rel="nofollow noreferrer">http://gethue.com/introducing-s3-support-in-hue/</a></li>
  <li>I <strong>can't</strong> access the table via 'Metastore Manager -> Database -> Table -> STATS -> Location'. I still get [Errno 22]</li>
  </ul>