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.

Sqoop error trying to define Parquet file with Decimal column datatype

Sqoop error trying to define Parquet file with Decimal column datatype

Explorer

When trying to "sqoop" data from a SQL Server 2008R2 table, a Decimal column defaults to a String datatype in the target Parquet file in HDFS. Using the "--map-column-java" option results in error messages:

 

ERROR orm.ClassWriter: No ResultSet method for Java type DECIMAL

ERROR tool.ImportTool: Imported Failed: No ResultSet method for Java type DECIMAL

 

These are the sqoop options read from a file:

--map-column-java PLAN_PERCENT=DECIMAL \
--as-parquetfile \
--fetch-size 10000 \
-m 24

Ideally, the target would be a DECIMAL(20,4). However, the sqoop option line does not like the precision and scale specification, giving an error when encountering the "(", so plain DECIMAL is used.

 

Sqoop is attempting to write the data directly to HDFS.

 

What are the correct Sqoop options to use to write a Parquet file to HDFS from a relational database table and convert the source table Decimal datatypes to target columns with Decimal datatypes?

1 REPLY 1
Highlighted

Re: Sqoop error trying to define Parquet file with Decimal column datatype

New Contributor

did you find a good solution?