· 8 years ago · May 05, 2018, 10:52 AM
1DROP TABLE IF EXISTS porder9;
2
3CREATE EXTERNAL TABLE IF NOT EXISTS `porder9`(
4 `seq` string,
5 `groupseq` string,
6 `uid` int,
7 `uname` string,
8 `appid` int,
9 `cardnum` string,
10 `ordertype` string,
11 `title` string,
12 `price` double,
13 `discount` double,
14 `goldamount` double,
15 `quantity` int,
16 `comment` string,
17 `ipv4` string,
18 `source` tinyint,
19 `status` tinyint,
20 `expressstatus` tinyint,
21 `metadata` string,
22 `channel` string,
23 `bank` string,
24 `tranid` string,
25 `pingid` string,
26 `openid` string,
27 `userdel` boolean,
28 `updated` bigint,
29 `created` bigint,
30 `signtime` bigint,
31 `refundname` string,
32 `couponprice` double,
33 `orderid` string,
34 `orderfee` double,
35 `coupondescribe` string,
36 `supplierid` int,
37 `appversion` string,
38 `buyerid` int,
39 `cid` int,
40 `pid` int,
41 `sid` int,
42 `img` string,
43 `attr` string,
44 `eid` int,
45 `ename` string,
46 `logisticsno` string,
47 `receivename` string,
48 `receivephone` string,
49 `receiveaddress` string,
50 `deliverytime` bigint,
51 `activeid` int,
52 `activediscountprice` double,
53 `start_time` timestamp,
54 `end_time` timestamp)
55ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' STORED AS TEXTFILE;
56
57load data local inpath "/data/order.txt" into table porder9;