Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

SQOOP export Hive View to Oracle

New Contributor

While trying to export Hive view to Oracle, columns are getting resolved. However the job fails with Null pointer exception. Does it SQOOP not support export data through view? If I change the view to table, it works as expected.


sqoop export -D --connect jdbc:netezza://hostdTL/dbName--table tblName --username userId --password password--hcatalog-table viewName --hcatalog-database dbName


Caused by: java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at org.apache.hive.hcatalog.mapreduce.FosterStorageHandler.<init>(
at org.apache.hive.hcatalog.common.HCatUtil.getStorageHandler(
at org.apache.hive.hcatalog.common.HCatUtil.getStorageHandler(
at org.apache.hive.hcatalog.mapreduce.InitializeInput.extractPartInfo(
at org.apache.hive.hcatalog.mapreduce.InitializeInput.getInputJobInfo(
at org.apache.hive.hcatalog.mapreduce.InitializeInput.setInput(
at org.apache.hive.hcatalog.mapreduce.HCatInputFormat.setInput(


Master Mentor



To understand your problem you should know the difference between a view and a table?

Views are definitions built on top of other tables or other views and do not hold data themselves. If data is changing in the underlying table, the same change is reflected in the view. A view can be built on top of a single table or multiple tables.


Now to answer your question a table contains data, a view is just a SELECT statement that has been saved in the database or metastore depending on your database.

This explains why the columns are getting resolved because the definition of the view exists but the NULL pointer exception tells you there is no data in that view as it ONLY holds the definition but not the data!

I haven't tried it yet in Oracle but I think it's not possible to import data from a view too, However, a materialized view is a physical copy of the base table could work in the export I am not sure, you could test that.


Happy hadooping



Super Guru

For Sqoop export, parameter "--export-dir" is required, please refer to below doc:

Export is designed to export HDFS data to RDBMS, not Hive tables to RDBMS.

Hope that helps.