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.

Spark error for select query from hive table

Spark error for select query from hive table

Explorer

Hi,

Am getting data exception error while getting timestamp(from hive table) from spark

sqlContext.sql("FROM table SELECT current_timestamp").collect().foreach(println);

Error:

DataTypeException: Unsupported dataType: char(1). If you have a struct and a field name of it has any special characters , please use backticks (`) to quote that field name, e.g. `x+y`. Please note that backtick itself is not supported in a field name.

Thanks

2 REPLIES 2

Re: Spark error for select query from hive table

Expert Contributor

This is a known issue. The char() field is not supported with Spark SQL. You'll have to change the field to varchar if you want to be able to query the table with Spark.

Highlighted

Re: Spark error for select query from hive table

Explorer

i was trying to query the varchar field of hive table from spark.

sqlContext.sql("FROM table SELECT name")

Still am getting the same error.