Member since
12-29-2015
26
Posts
3
Kudos Received
2
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1217 | 11-21-2017 07:21 AM | |
8101 | 09-07-2016 03:07 PM |
06-02-2025
06:55 AM
It does looks like query failed with ClassCastException. It indicates that ( org.apache.hadoop.hive.serde2.io.HiveDecimalWritable cannot be cast to org.apache.hadoop.io.LongWritable ) a mismatch between the data type Hive expects and the data type it's actually encountering while processing the query. From the Error trace , Hive treats a value as a DECIMAL(HiveDecimalWritable) but the metadata seems to be Long(LongWritable). One possible Reason might be Schema Mismatch: Hive table schema defines a column but the underlying data file (e.g., Parquet, ORC, ...) for that column actually contains DECIMAL Values. To validate , Run DESCRIBE FORMATTED <your_table_name>; for the table involved in the failing query. Pay close attention to the data types of all columns, especially those that might be involved in the conversion. Compare these Hive schema data types with the actual data types in your source data files. For example, if you're using Parquet, use tools like parquet-tools to inspect the schema of Parquet files. if you're using ORC , use hive --orcfiledump to inspect the schema of orc files. Also make sure that Serde's pointing to valid underlying file formats.
... View more
11-19-2020
03:18 AM
I too have the same scenario where in the column was decimal and updated to bigint, now getting error while querying the column. the data type on the table and the parquet file are aligned. Error: java.io.IOException: java.lang.ClassCastException: org.apache.hadoop.io.LongWritable cannot be cast to org.apache.hadoop.hive.serde2.io.HiveDecimalWritable (state=,code=0) If you have already resolved the issue, much appreciate if you could let know what worked for you. Thanks Dinesh
... View more
07-15-2018
01:56 PM
Thanks @ Sandeep Nemuri @ rguruvannagari works fine
... View more
11-21-2017
07:21 AM
Here is the solution for that WHEN a1.Col1 = '1' THEN "b1.col2" Else CAST ('' as timestamp) END as Col3 . It will work
... View more
07-18-2017
08:10 PM
2 Kudos
@Sundar Lakshmanan When you are having a derived column then you should create an alias for it instead of treating it like a variable assignment. Ex. Select (your calculation for derived column) as derived_column. SELECT CONSUMER_R , CNTRY_ISO_C ,
(CASE WHEN ( DTBIRTH_Y = '0001-01-01' ) THEN 0 ELSE cast((DATEDIFF(current_date,'0001-01-01')/365) as smallint) END) as NEW_AGE,
....
... View more
11-03-2016
01:01 PM
@Sundar Lakshmanan Glad it helped. Happy Hadooping!
... View more
10-21-2016
02:06 PM
1 Kudo
@Sundar Lakshmanan Glad we found the problem. If you are satisfied, please accept the original answer. (That's how HCC works 🙂
... View more
10-03-2016
10:40 AM
@Sundar Lakshmanan If "Yess", can you please accept Ayub's answer to help us manage answered questions. Tnx!
... View more
07-05-2018
04:02 AM
Well, this is my first visit to your blog! Your blog provided us valuable information .You have done a marvelous job - happy wheels , I think this is an informative post and it is very useful and knowledgeable. I really enjoyed reading this post. big fan, thank you! - happy wheels
... View more