0 votes
in Big Data | Hadoop by
DDL Satements

CREATE:

  1. Create a database.
create database fresco;
  1. Create a table.
create table tablename (col1 int,col2 string,col3 int) row format delimited fields terminated by ',';
  1. Create a View.
hive> CREATE VIEW <viewname> AS
SELECT * FROM employee
WHERE age>25;
  1. 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'

  1. 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';
...