Database Reference
In-Depth Information
• When using uncompressed text files with Impala, you can just copy them
onto HDFS first. After that, use CREATE TABLE and then use the INSERT
statement to copy them into Impala.
Now let's take a look at some of the SQL statements that you can use with various
input file types in Impala.
The regular text file format with Impala tables
By default, Impala uses the text file format with the CREATE TABLE syntax. When
data is inserted into this table using INSERT , Ctrl + A (Hex 01) is used as a default
delimiter. The default syntax is as follows:
CREATE TABLE users (userID int, username
string);
To change the delimiter to, for example, , , \t , | , or your_choice , you can use the
following syntax:
CREATE TABLE users (userID int, username
string) STORED AS textfile FIELDS TERMINATED BY
'\t';
Tip
Please visit the Cloudera Impala documentation for text file format support at the
following URL:
http://www.cloudera.com/content/cloudera-content/cloudera-docs/Impala/latest/
Installing-and-Using-Impala/ciiu_txtfile.html
The Avro file format with Impala tables
With the Avro file format, you would have to create tables in Hive first, as shown in
the following code snippet:
Search WWH ::




Custom Search