Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You manage files directly using Hive Table commands</p> <p>Firstly if you want to use external data controlled outside Hive use the External Command when creating the table</p> <pre><code>set S3Path='s3://Bucket/directory/'; CREATE EXTERNAL TABLE IF NOT EXISTS S3table ( data STRING ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION ${hiveconf:S3Path}; </code></pre> <p>You can now insert data into this table</p> <pre><code> INSERT OVERWRITE TABLE S3table SELECT data FROM DynamoDBtable; </code></pre> <p>This will create text files in S3 inside the directory location Note depending on the data size and number of reducers there may be multiple text files. Files names are also random GUID element i.e. 03d3842f-7290-4a75-9c22-5cdb8cdd201b_000000</p> <pre><code>DROP TABLE S3table; </code></pre> <p>Dropping the table just breaks the link to the files</p> <p>Now if you want to manage the directory you can create a table that will take control of the S3 directory (Note there is no <code>external</code> command)</p> <pre><code>CREATE TABLE IF NOT EXISTS S3table ( data STRING ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION ${hiveconf:S3Path}; </code></pre> <p>If you now issue a drop table command all files in the folder are delete immediately</p> <pre><code>DROP TABLE S3table; </code></pre> <p>I suggest you create a non external table then drop it and carry on with the rest of your script. If you encounter errors you will have a blank directory after the job finishes</p> <p>Hope this covers what you need</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload