第1关
#******* Begin *******#
echo "
create database if not exists test1;
create table if not exists test1.student(Sno INT,name STRING,age INT,sex STRING,score STRUCT<Chinese:FLOAT,Math:FLOAT,English:FLOAT>);
create view student_view as select Sno,name,age,sex,score from test1.student;
alter view student_view rename to student_info_views;
drop view if exists student_info_views;
"
#******* End *******#
第2关
#******* Begin *******#
echo "
create database if not exists test2;
create table if not exists test2.student(Sno INT,name STRING,age INT,sex STRING,score STRUCT<Chinese:FLOAT,Math:FLOAT,English:FLOAT>) row format delimited fields terminated by ',' collection items terminated by '-';
load data local inpath '/home/student.txt' overwrite into table student;
create index student_index on table student(Sno) as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' with deferred rebuild in table student_index_table;
drop index if exists student_index on student;
"
#******* End *******#
如以上代码格式错误请下载txt版本
