hive创建表时ascii编码与unicode编码的对应

CREATE TABLE page_view(viewTime INT, userid BIGINT,
     page_url STRING, referrer_url STRING,
     ip STRING COMMENT 'IP Address of the User')
 COMMENT 'This is the page view table'
 PARTITIONED BY(dt STRING, country STRING)
 ROW FORMAT DELIMITED
   FIELDS TERMINATED BY '\001'
STORED AS textfile;


hive> show create table page_view;
OK
CREATE TABLE `page_view`(
  `viewtime` int, 
  `userid` bigint, 
  `page_url` string, 
  `referrer_url` string, 
  `ip` string COMMENT 'IP Address of the User')
COMMENT 'This is the page view table'
PARTITIONED BY ( 
  `dt` string, 
  `country` string)
ROW FORMAT DELIMITED 
  FIELDS TERMINATED BY '\u0001' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
  'hdfs://ytns1/user/hive/warehouse/test.db/page_view'
TBLPROPERTIES (
  'transient_lastDdlTime'='1487572774')
Time taken: 0.328 seconds, Fetched: 20 row(s)


--------------------------------------------------------------------


CREATE TABLE page_view2(viewTime INT, userid BIGINT,
     page_url STRING, referrer_url STRING,
     ip STRING COMMENT 'IP Address of the User')
 COMMENT 'This is the page view table'
 PARTITIONED BY(dt STRING, country STRING)
 ROW FORMAT DELIMITED
   FIELDS TERMINATED BY '\036'
STORED AS textfile;


hive> show create table page_view2;
OK
CREATE TABLE `page_view2`(
  `viewtime` int, 
  `userid` bigint, 
  `page_url` string, 
  `referrer_url` string, 
  `ip` string COMMENT 'IP Address of the User')
COMMENT 'This is the page view table'
PARTITIONED BY ( 
  `dt` string, 
  `country` string)
ROW FORMAT DELIMITED 
  FIELDS TERMINATED BY '\u001E' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
  'hdfs://ytns1/user/hive/warehouse/test.db/page_view2'
TBLPROPERTIES (
  'transient_lastDdlTime'='1487572944')
Time taken: 0.118 seconds, Fetched: 20 row(s)
-----------------------------------------------------------------------


CREATE TABLE page_view3(viewTime INT, userid BIGINT,
     page_url STRING, referrer_url STRING,
     ip STRING COMMENT 'IP Address of the User')
 COMMENT 'This is the page view table'
 PARTITIONED BY(dt STRING, country STRING)
 ROW FORMAT DELIMITED
   FIELDS TERMINATED BY '\002'
STORED AS textfile;


hive> show create table page_view3;
OK
CREATE TABLE `page_view3`(
  `viewtime` int, 
  `userid` bigint, 
  `page_url` string, 
  `referrer_url` string, 
  `ip` string COMMENT 'IP Address of the User')
COMMENT 'This is the page view table'
PARTITIONED BY ( 
  `dt` string, 
  `country` string)
ROW FORMAT DELIMITED 
  FIELDS TERMINATED BY '\u0002' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
  'hdfs://ytns1/user/hive/warehouse/test.db/page_view3'
TBLPROPERTIES (
  'transient_lastDdlTime'='1487573211')
Time taken: 0.106 seconds, Fetched: 20 row(s)


------------------------------------------------------------------
CREATE TABLE page_view4(viewTime INT, userid BIGINT,
     page_url STRING, referrer_url STRING,
     ip STRING COMMENT 'IP Address of the User')
 COMMENT 'This is the page view table'
 PARTITIONED BY(dt STRING, country STRING)
 ROW FORMAT DELIMITED
   FIELDS TERMINATED BY '\003'
STORED AS textfile;


hive> show create table page_view4;
OK
CREATE TABLE `page_view4`(
  `viewtime` int, 
  `userid` bigint, 
  `page_url` string, 
  `referrer_url` string, 
  `ip` string COMMENT 'IP Address of the User')
COMMENT 'This is the page view table'
PARTITIONED BY ( 
  `dt` string, 
  `country` string)
ROW FORMAT DELIMITED 
  FIELDS TERMINATED BY '\u0003' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
  'hdfs://ytns1/user/hive/warehouse/test.db/page_view4'
TBLPROPERTIES (
  'transient_lastDdlTime'='1487573249')
Time taken: 0.114 seconds, Fetched: 20 row(s)

你可能感兴趣的:(hive相关)