The project I am working receive data in the form a Avro files. I am writing a generic code in Scala (using Scala IDE) to read all Avro files present in a folder and create a table for each of the avro file.
I am reading the avro file data as a dataframe and using below code to write the same back to Impala database (using JDBC).
df.write.mode("overwrite").format("jdbc").options(jdbcOptions).saveAsTable("table1")
When I execute this code, I receive an error with create statement.
[Cloudera][ImpalaJDBCDriver](500051) ERROR processing query/statement.
Error Code: 0,
SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000,
errorMessage:AnalysisException: Syntax error in line 1:
...table1 ("col_message_key" DECIMAL(12,0)...
I am expecting the code to create a table with the name 'table1'
Could you please help me with this?