1
votes

When I try to create an external ORC table and provide the location I get this below error. The error seems to be related to tblproperties. If take out the tblproperties and run it, it runs fine. However I would then have to use the alter table command to update the tblproperties to be SNAPPY. Is anyone facing similar issue? I am not sure if there is a JIRA opened if its bug in hive. Any inputs are appreciated. Thanks.

hive (default)> create external table Addresses (
              >   name string,
              >   street string,
              >   city string,
              >   state string,
              >   zip int
              > ) stored as orc tblproperties ("orc.compress"="SNAPPY")
              > LOCATION '/user/abc/address_orc';
FAILED: ParseException line 8:0 missing EOF at 'LOCATION' near ')'
hive (default)>
1

1 Answers

5
votes

hi try the below create statement. it worked for me :)

hive (vijay)>
            >  create external table Addresses (
            >   name string,
            >   street string,
            >   city string,
            >   state string,
            >   zip int
            >  ) stored as orc
            >  LOCATION '/user/vijay/address_orc'
            > tblproperties ("orc.compress"="SNAPPY");
OK
Time taken: 0.212 seconds
hive (vijay)> describe Addresses;
OK
# col_name              data_type               comment

name                    string                  from deserializer
street                  string                  from deserializer
city                    string                  from deserializer
state                   string                  from deserializer
zip                     int                     from deserializer

Note tblproperties mentioned as last line after LOCATION