Database Reference
In-Depth Information
To create tables using HCatalog, you use the Create Table command.
When creating the table you need to define the column names and data
types. HCatalog supports the same data types and is similar to those
supported by most database systems such as integer, boolean, float, double,
string, binary, and timestamp. Complex types such as the array, map, and
struct are also supported. The following code creates an airport table in the
flight database to hold airport locations:
Create Table flight.airport
(code STRING, name STRING, country STRING,
latitude double, longitude double)
Once a table is created, you can use the Describe command to see a list of
the columns and data types. If you want to see a complete listing of the table
metadata, include the Extended keyword, as follows:
Describe Extended flight.airport;
Figure 7.8 shows this command output.
Figure 7.8 Extended description of the airport table.
Once a table is created, you can issue ALTER TABLE statements to do
things like changing the table name, alter table properties, change column
names,andchangecolumndatatypes.Forexample,thefollowingcommand
changes the table name:
 
 
Search WWH ::




Custom Search