CREATE:
- Create a database.
create database fresco;
- Create a table.
create table tablename (col1 int,col2 string,col3 int) row format delimited fields terminated by ',';
- Create a View.
hive> CREATE VIEW <viewname> AS
SELECT * FROM employee
WHERE age>25;
- Create a function.
CREATE FUNCTION [IF NOT EXISTS] [db_name.]function_name([arg_type[, arg_type...])
RETURNS return_type
LOCATION 'hdfs_path'
SYMBOL='symbol_or_class'
- Create Index.
It will act as a pointer, what changes will be made in the particular col, will be done using the index.
hive> CREATE INDEX index_col ON TABLE tablename(col)
AS 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler';