Support Questions

Find answers, ask questions, and share your expertise

orcfiledump command throwing the error.

New Contributor

Hi,

I am trying to generate the orcfile but getting the error.

Please help.

bin/hive --orcfiledump /user/hive/warehouse/hello.db/mylineitem/000000_0
Exception in thread "main" java.lang.ClassNotFoundException: org.apache.orc.tools.FileDump
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

 

hive> dfs -ls /user/hive/warehouse/hello.db/mylineitem;
Found 2 items
-rw-r--r-- 1 i538738 users 94991181 2021-01-30 08:54 /user/hive/warehouse/hello.db/mylineitem/000000_0
-rw-r--r-- 1 i538738 users 48492091 2021-01-30 08:54 /user/hive/warehouse/hello.db/mylineitem/000001_0

 

hive> show create table mylineitem;
OK
CREATE TABLE mylineitem(
l_orderkey bigint COMMENT 'from deserializer',
l_partkey int COMMENT 'from deserializer',
l_suppkey int COMMENT 'from deserializer',
l_linenumber int COMMENT 'from deserializer',
l_quantity decimal COMMENT 'from deserializer',
l_extendedprice decimal COMMENT 'from deserializer',
l_discount decimal COMMENT 'from deserializer',
l_tax decimal COMMENT 'from deserializer',
l_returnflag varchar(1) COMMENT 'from deserializer',
l_linestatus varchar(1) COMMENT 'from deserializer',
l_shipdate date COMMENT 'from deserializer',
l_commitdate date COMMENT 'from deserializer',
l_receiptdate date COMMENT 'from deserializer',
l_shipinstruct varchar(25) COMMENT 'from deserializer',
l_shipmode varchar(10) COMMENT 'from deserializer',
l_comment varchar(44) COMMENT 'from deserializer')
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '|'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'file:/user/hive/warehouse/hello.db/mylineitem'

TBLPROPERTIES (
'totalSize'='143483272',
'numRows'='6001215',
'rawDataSize'='0',
'numFiles'='2',
'numPartitions'='0',
'transient_lastDdlTime'='1611996844')
Time taken: 0.367 seconds, Fetched: 32 row(s)

1 REPLY 1

Rising Star

Hello @anujseeker 

 

It seems you are using the wrong path of hive. Below command works for me.

 

hive --orcfiledump -d --rowindex 5 /warehouse/tablespace/managed/hive/tkathpal.db/orctable/delta_0000001_0000001_0000/bucket_00000

 

Now in my case, hive points to the actual parcel.

 

[root@c2511-node1 ~]# which hive

/usr/bin/hive

[root@c2511-node1 ~]# ls -lt /usr/bin/hive

lrwxrwxrwx 1 root root 22 Aug  3  2020 /usr/bin/hive -> /etc/alternatives/hive

[root@c2511-node1 ~]# ls -lt /etc/alternatives/hive

lrwxrwxrwx 1 root root 62 Aug  3  2020 /etc/alternatives/hive -> /opt/cloudera/parcels/CDH-7.1.1-1.cdh7.1.1.p0.3266817/bin/hive

 

So when I run hive, ultimately the jars is being picked up from the right path. Could you please check the same on your end?

 

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.