Hi,
I am trying to store the output of hive query which uses OXH:xml_table() UDF provided by OXH, but it fails to store the output of the query to a directory or table.
Note: query works fine with CLI but has problem when storing the output of query to HDFS directory or Table.
Query:
hive> SELECT institution, t.accountnumber, t.docrefid FROM reportinggroup LATERAL VIEW
xml_table(
struct("ftc", "urn:abc:def:ghi:v2", "sfa", "urn:abc:def:stftypes:v2" ),
"
let $reportinggroup :=./ftc:ReportingGroup
for $accountreport in $reportinggroup/ftc:AccountReport
return
<r>
{$accountreport/ftc:AccountNumber}
{$accountreport/ftc:DocSpec/ftc:DocRefId}
</r>
",
reportinggroup.reportinggroup,
struct("./ftc:AccountNumber", "./ftc:DocRefId")) t AS accountnumber,docrefid;
OK
LQG1 12345678 0000000002
LQG1 12345678 0000000003
LQG1 23456789 0000000004
LQG1 23456789 0000000005
Time taken: 1.889 seconds, Fetched: 4 row(s)
The above work fine and gives output but when i try
INSERT OVERWRITE DIRECTORY 'mydir'
SELECT institution, t.accountnumber, t.docrefid FROM reportinggroup LATERAL VIEW
xml_table(
struct("ftc", "urn:abc:def:ghi:v2", "sfa", "urn:abc:def:stftypes:v2" ),
"
let $reportinggroup :=./ftc:ReportingGroup
for $accountreport in $reportinggroup/ftc:AccountReport
return
<r>
{$accountreport/ftc:AccountNumber}
{$accountreport/ftc:DocSpec/ftc:DocRefId}
</r>
",
reportinggroup.reportinggroup,
struct("./ftc:AccountNumber", "./ftc:DocRefId")) t AS accountnumber,docrefid;
it fails with below error:
Query ID = ibietl_20170306120101_32e2205c-d826-4abd-b180-d91d1f8dee01
Total jobs = 3
Launching Job 1 out of 3
Number of reduce tasks is set to 0 since there's no reduce operator
java.lang.IllegalArgumentException: Can not create a Path from an empty string
at org.apache.hadoop.fs.Path.checkPathArg(Path.java:127)
at org.apache.hadoop.fs.Path.<init>(Path.java:135)
at org.apache.hadoop.fs.Path.<init>(Path.java:94)
at org.apache.hadoop.mapreduce.JobSubmitter.copyRemoteFiles(JobSubmitter.java:142)
at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:216)
at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:390)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:483)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1306)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1303)
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:1671)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1303)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:564)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:559)
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:1671)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:559)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:550)
at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.execute(ExecDriver.java:429)
at org.apache.hadoop.hive.ql.exec.mr.MapRedTask.execute(MapRedTask.java:137)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:88)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1638)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1398)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1182)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1048)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1038)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:207)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:159)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:370)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:756)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Job Submission failed with exception 'java.lang.IllegalArgumentException(Can not create a Path from an empty string)'
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask