Skip to Main Content

Data Lake & Services

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OXH: storing output of query using xml_table() to directory fails

Mufaddal KMar 6 2017 — edited Apr 3 2017

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

Comments

Glen Conway

Yeah, testing on Windows, the change in behavior occurred in release 18.2

User_H3J7U

20.3 problem again.
C:\>sql /nolog
Picked up JAVA_TOOL_OPTIONS: -Dnashorn.args=--no-deprecation-warning
SQLcl: Release 20.3 Production on вт нояб. 24 00:33:55 2020
Copyright (c) 1982, 2020, Oracle. All rights reserved.
SQL> ^C
C:\>
Pressing ctrl-c while running query aborts sql.exe, but sql is still active on the server.
C:\>java -version
Picked up JAVA_TOOL_OPTIONS: -Dnashorn.args=--no-deprecation-warning
java version "11.0.9" 2020-10-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.9+7-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.9+7-LTS, mixed mode)

Billy Verreynne

Also an issue with sqlplus as I detailed in https://community.oracle.com/tech/developers/discussion/4174536/oci-behaviour-of-12c-dedicated-server-process-to-a-client-ocibreak-call#latest
No answers as to why this behaviour is now different.

1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 1 2017
Added on Mar 6 2017
1 comment
558 views