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

Beeline command to output the result into a .tsv file failing

Highlighted

Beeline command to output the result into a .tsv file failing

New Contributor

I am trying to run a select query on an hive table using beeline command and store the output into .tsv file as below

beeline -u 'jdbc:hive2://localhost:10000/$dbname' --outputformat=dsv -e 'add jar hdfs://localhost:8020/tmp/hivexmlserde-1.0.5.3.jar; Select * from <tablename> where <columnname>between 1 and 10000; ' > <filename.tsv>

but its giving me below error . May some one please let me know the cause of the esame.

==========================================================================================

ERROR : Failed to execute tez graph. java.io.IOException: Previous writer likely failed to write hdfs://sjc04p1hdpmn101.teslamotors.com:8020/tmp/hive/anonymous/_tez_session_dir/ea4e25e8-f25f-4b48-8ec6-3b6be4ef59c4/hive-hcatalog-core.jar. Failing because I am unlikely to write too. at org.apache.hadoop.hive.ql.exec.tez.DagUtils.localizeResource(DagUtils.java:982) at org.apache.hadoop.hive.ql.exec.tez.DagUtils.addTempResources(DagUtils.java:862) at org.apache.hadoop.hive.ql.exec.tez.DagUtils.localizeTempFilesFromConf(DagUtils.java:805) at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.refreshLocalResourcesFromConf(TezSessionState.java:233) at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.open(TezSessionState.java:158) at org.apache.hadoop.hive.ql.exec.tez.TezTask.updateSession(TezTask.java:271) at org.apache.hadoop.hive.ql.exec.tez.TezTask.execute(TezTask.java:151) at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160) at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:89) at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1728) at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1485) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1262) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1126) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1121) at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:154) at org.apache.hive.service.cli.operation.SQLOperation.access$100(SQLOperation.java:71) at org.apache.hive.service.cli.operation.SQLOperation$1$1.run(SQLOperation.java:206) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1709) at org.apache.hive.service.cli.operation.SQLOperation$1.run(SQLOperation.java:218) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

==========================================================================================

1 REPLY 1
Highlighted

Re: Beeline command to output the result into a .tsv file failing

@Kapil Khandelwal

Does your user you use to execute beeline command have the proper privileges to write to your current folder where you intend to place filename.tsv?

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