use tpch; create external table lineitem ( l_orderkey int, l_partkey int, l_suppkey int, l_linenumber int, l_quantity double, l_extendedprice double, l_discount double, l_tax double, l_returnflag string, l_linestatus string, l_shipdate string, l_commitdate string, l_receiptdate string, l_shipinstruct string, l_shipmode string, l_comment string ) stored as parquet location 'file:///opt/data/spark/tpch/lineitem'; INSERT INTO lineitem SELECT * FROM tpchtxt.lineitem; create external table nation ( n_nationkey int, n_name string, n_regionkey int, n_comment string ) stored as parquet location 'file:///opt/data/spark/tpch/nation'; INSERT INTO nation SELECT * FROM tpchtxt.nation; create external table region ( r_regionkey int, r_name string, r_comment string ) stored as parquet location 'file:///opt/data/spark/tpch/region'; INSERT INTO region SELECT * FROM tpchtxt.region; create external table part ( p_partkey int, p_name string, p_mfgr string, p_brand string, p_type string, p_size int, p_container string, p_retailprice double, p_comment string ) stored as parquet location 'file:///opt/data/spark/tpch/part'; INSERT INTO part SELECT * FROM tpchtxt.part; create external table supplier ( s_suppkey int, s_name string, s_address string, s_nationkey int, s_phone string, s_acctbal double, s_comment string ) stored as parquet location 'file:///opt/data/spark/tpch/supplier'; INSERT INTO supplier SELECT * FROM tpchtxt.supplier; create external table partsupp ( ps_partkey int, ps_suppkey int, ps_availqty int, ps_supplycost double, ps_comment string ) stored as parquet location 'file:///opt/data/spark/tpch/partsupp'; INSERT INTO partsupp SELECT * FROM tpchtxt.partsupp; create external table customer ( c_custkey int, c_name string, c_address string, c_nationkey int, c_phone string, c_acctbal double, c_mktsegment string, c_comment string ) stored as parquet location 'file:///opt/data/spark/tpch/customer'; INSERT INTO customer SELECT * FROM tpchtxt.customer; create external table orders ( o_orderkey int, o_custkey int, o_orderstatus string, o_totalprice double, o_orderdate date, o_orderpriority string, o_clerk string, o_shippriority int, o_comment string ) stored as parquet location 'file:///opt/data/spark/tpch/orders'; INSERT INTO orders SELECT * FROM tpchtxt.orders;