Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.
The "Hive/LanguageManual/DDL" page has been changed by JohnSichi. http://wiki.apache.org/hadoop/Hive/LanguageManual/DDL?action=diff&rev1=27&rev2=28 -------------------------------------------------- {{{ CREATE [EXTERNAL] TABLE [IF NOT EXISTS] table_name [(col_name data_type [COMMENT col_comment], ...)] - [table_comment] + [COMMENT table_comment] [PARTITIONED BY (col_name data_type [col_comment], col_name data_type [COMMENT col_comment], ...)] [CLUSTERED BY (col_name, col_name, ...) [SORTED BY (col_name, ...)] INTO num_buckets BUCKETS] [ROW FORMAT row_format] @@ -62, +62 @@ Partitioned tables can be created using PARTIONED BY clause. A table can have one or more partition columns and a separate data directory is created for each set of partition columns values. Further tables or partitions can be bucketed using CLUSTERD BY columns and data can be sorted with in that bucket by SORT BY columns. This can improve performance on certain kind of queries. - Table names and column names are case insensitive but SerDe and property names are case sensitive. + Table names and column names are case insensitive but SerDe and property names are case sensitive. Table and column comments are string literals (single-quoted). Tables can also be created and populated by the results of a query in one CTAS (create-table-as-select) statement. The table created by CTAS is atomic, meaning that the table is not seen by other users until all the query results are populated. So other users will either see the table with the complete results of the query or will not see the table at all. @@ -80, +80 @@ PARTITIONED BY(dt STRING, country STRING) STORED AS SEQUENCEFILE; }}} - The statement above creates page_view table with viewTime, userid, page_url, referrer_url, up columns with a comment. The table is also partitioned and data is stored in sequence files. The data format in the files is assumed to be field-delimited by ctrl-A and row-delimited by newline. + The statement above creates page_view table with viewTime, userid, page_url, referrer_url, and ip columns with a comment. The table is also partitioned and data is stored in sequence files. The data format in the files is assumed to be field-delimited by ctrl-A and row-delimited by newline. {{{ CREATE TABLE page_view(viewTime INT, userid BIGINT,
