Convert string to date in Sparkr - Databricks

Asked

Viewed 81 times

1

I’m treating a dataframe in the algorithm prophet in my work, for both in the Rstudio used the following code to convert data from Data who are like string for Date, because the algorithm needs this format to make its predictions.

Feriados$Data <- as.Date(Feriados$Data, '%d/%m/%Y')

But when I run this code on Sparkr it returns me the field with values null or details this error

Error in as.Date.default(Feriados$Data, "%d/%m/%Y") : 
  do not know how to convert 'Feriados$Data' to class “Date”

Can you help me?

printSchema(Feriados)
select * from feriados

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.