Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Facing issue while loading HDFS file into Hive


Facing issue while loading HDFS file into Hive

New Contributor

Hi All,


I am trying to write data into hive using R Studio, for which first I am storing data into HDFS and from there I want to insert data into Hive.


R to HDFS: I am using below code to generate HDFS(i.e. txt) file which is working fine.


modelfile <- hdfs.file("/Result.txt", "w")

data1 <- toJSON(hdfsfile)

data2 <- charToRaw(data1)




Out Put data format: 



Issue: Now the issue is writing and reading this data from Hive.

We are able to insert this result into hive. But when try to read, getting below error.

> archive_data <- dbGetQuery(hivecon, "SELECT * from Table")
Error in .jcall(rp, "I", "fetch", stride, block) :
  org.apache.hive.service.cli.HiveSQLException: org.apache.hadoop.hive.serde2.SerDeException: Start token not found where expected
can this be the issueJSON should start with { and not with array ([)?
Appreciate your support in resolving this issue.
Thanks in Advance,



Don't have an account?
Coming from Hortonworks? Activate your account here