sql - HIve CLI doesn't support MySql style data import to tables -


why can't import data hive cli following, hive_test table has user, comments columns.

insert table hive_test (user, comments)  value ("hello", "this test query"); 

hive throws following exception in hive cli

failed: parseexception line 1:28 cannot recognize input near '(' 'user' ',' in select clause

i don't want import data through csv file following testing perpose.

load data local inpath '/home/hduser/test_data.csv' table hive_test; 

it's worth noting hive advertises "sql-like" syntax, rather actual sql syntax. there's no particular reason think pure sql queries run on hive. hiveql's dml documented here on wiki, , not support column specification syntax or values clause. however, support syntax:

insert table tablename1 select ... ... 

extrapolating these test queries, might able following work:

insert table hive_test select 'hello', 'this test query' src limit 1 

however, seem hive not optimized small-scale data manipulation. don't have hive instance test of on.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -