Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toddlipcon/74bdef8a69b558763e4453ac21313649 to your computer and use it in GitHub Desktop.
Save toddlipcon/74bdef8a69b558763e4453ac21313649 to your computer and use it in GitHub Desktop.
[nightly6x-2.gce.cloudera.com:21000] default> create table mixedtable (x int) partitioned by (y int) stored as parquetfile TBLPROPERTIES ('avro.schema.url'='/user/systest/avro-schema.json');
Query: create table mixedtable (x int) partitioned by (y int) stored as parquetfile TBLPROPERTIES ('avro.schema.url'='/user/systest/avro-schema.json')
+-------------------------+
| summary |
+-------------------------+
| Table has been created. |
+-------------------------+
Fetched 1 row(s) in 0.48s
[nightly6x-2.gce.cloudera.com:21000] default> describe mixedtable;
Query: describe mixedtable
+------+------+---------+
| name | type | comment |
+------+------+---------+
| x | int | |
| y | int | |
+------+------+---------+
Fetched 2 row(s) in 4.65s
[nightly6x-2.gce.cloudera.com:21000] default> alter table mixedtable add partition (y=1);
Query: alter table mixedtable add partition (y=1)
+--------------------------------------------+
| summary |
+--------------------------------------------+
| New partition has been added to the table. |
+--------------------------------------------+
Fetched 1 row(s) in 0.09s
[nightly6x-2.gce.cloudera.com:21000] default> alter table mixedtable partition (y=1) set fileformat avro;
Query: alter table mixedtable partition (y=1) set fileformat avro
+-------------------------+
| summary |
+-------------------------+
| Updated 1 partition(s). |
+-------------------------+
Fetched 1 row(s) in 0.19s
[nightly6x-2.gce.cloudera.com:21000] default> describe mixedtable;
Query: describe mixedtable
+------+------+---------+
| name | type | comment |
+------+------+---------+
| x | int | |
| y | int | |
+------+------+---------+
Fetched 2 row(s) in 0.00s
[nightly6x-2.gce.cloudera.com:21000] default> refresh mixedtable;
Query: refresh mixedtable
Query submitted at: 2018-07-11 15:41:56 (Coordinator: https://nightly6x-2.gce.cloudera.com:25000)
Query progress can be monitored at: https://nightly6x-2.gce.cloudera.com:25000/query_plan?query_id=7545fdc18de7c3c4:8475dd8800000000
Fetched 0 row(s) in 0.06s
[nightly6x-2.gce.cloudera.com:21000] default> describe mixedtable;
Query: describe mixedtable
+-------+--------+-------------------+
| name | type | comment |
+-------+--------+-------------------+
| first | string | from deserializer |
| last | string | from deserializer |
| y | int | |
+-------+--------+-------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment