Member since
11-24-2015
223
Posts
10
Kudos Received
0
Solutions
09-12-2018
07:38 PM
so with a table created as above, how should the data be to be able to load it in? in what format that is? because i am not specifying any delimiters etc. appreciate the insights.
... View more
09-12-2018
06:53 PM
any idea what is wrong with this : CREATE EXTERNAL TABLE staging3
ROW FORMAT SERDE 'org.apache.hadoop.hive.serd2.avro.AvroSerDe' STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat' TBLPROPERTIES ('avro.schema.url'='hdfs:///tmp/avroschemas/testtbl.json') LOCATION '/tmp/staging'; I am getting : FAILED: ParseException line 7:0 missing EOF at 'LOCATION' near ')'
... View more
09-12-2018
03:58 PM
so is there no way to load the data automatically from the files coming into a particular directory in hdfs?
... View more
09-12-2018
03:57 PM
ok, i used the "load data" command to load the data into the staging table. selecting from the table i can see below output : hive> select * from staging; OK {"tid":"1","action":"success","createdts":null}312345 Time taken: 0.398 seconds, Fetched: 1 row(s) Is that good? I am kind of concerned with the flower braces and the column names in the resultant data.
... View more
09-12-2018
03:36 PM
>create table staging(id struct<tid:string,action:string,createdts:timestamp>, cid string, anumber string) row format delimited fields >terminated by ',' collection items terminated by '|' stored as textfile; >sample text data can be as below >1|success|150987428888,3,12345 >insert into testtbl select * from staging; how is the text data loaded into the staging table? Also is it possible to use the 'load data' command in this context : load data inpath '/tmp/test.csv' into table testtbl; Appreciate the clarification.
... View more
09-12-2018
02:38 PM
and is it not possible to insert values without another table (t) like : hive> insert into testtbl values NAMED_STRUCT('tid','3','action','success', 'createdts',150987428888) as id ,'3' as cid,'12345' as anumber;
FAILED: ParseException line 1:27 extraneous input 'NAMED_STRUCT' expecting ( near ')'
line 1:107 missing EOF at 'as' near ')'
... View more
09-12-2018
02:31 PM
naresh and shu, thanks so much - both the statements worked! one more question : if i have data files (for similar avro tables) being sent to a directory in hdfs (through kafka/flume) what is the best way to load it into the table? is there any way that i can configure it such that data is picked up automatically from the directory path? appreciate the feedback.
... View more
09-12-2018
12:27 PM
1 Kudo
I have this table with what I believe is a nested column. I created this table with the statement : create table testtbl stored as AVRO TBLPROPERTIES ('avro.schema.url'='hdfs://testhost:8020/tmp/avroschemas/testtbl.json'); testtbl.json looks like : { "type" : "record", "name" : "testtbl", "namespace" : "orgn.data.domain", "fields" : [ { "name" : "id", "type" : { "type" : "record", "name" : "Key", "fields" : [ { "name" : "TId", "type" : "string" }, { "name" : "action", "type" : "string" }, { "name" : "createdTS", "type" : { "type" : "long", "logicalType" : "timestamp-millis" } } ] } }, { "name" : "CId", "type" : "string" }, { "name" : "ANumber", "type" : "string" } ] } Can somebody give me a valid insert statement to insert one row into the table. Appreciate the help.
... View more
Labels:
- Labels:
-
Apache Hive
07-17-2018
02:08 PM
We need to move hive metastore and other hive related components from one node to another. I already checked on the older posts and a thread on this suggests using the move option in ambari. But is there any particular order to follow as to which service to move first while doing using the move option : hive mysql server, hive metastore, hive server2 and is webhcat server part of hive? appreciate the insights.
... View more
Labels:
- Labels:
-
Apache Hive