Reputation: 115
I have a error like:
com.databricks.backend.common.rpc.DatabricksExceptions$SQLExecutionException: org.apache.spark.sql.catalyst.parser.ParseException: no viable alternative at input 'alter table x9concsheet5 Add netto_resultaat'(line 1, pos 29)*
when i run this sql command in databricks:
%sql alter table x9concsheet5 Add netto_resultaat numeric(17,2)
The requirement is to change the column type from string to numeric from the temporary table x9concsheet5.
Any suggestions?
Upvotes: 0
Views: 1240
Reputation: 2334
you can use following command to modify the data type
ALTER TABLE table_name CHANGE old_col_name new_col_name new_data_type
but when are you are tying to modify the column type from string to decimal(17,2), you can do following step ,
netto_resultaat
with numeric value from stringUpvotes: 2