1

I would have a simple question... I try to use a function that ate a dataframe as argument and returns another dataframe

I do:

val get_nb_previous_offre : ((DataFrame) => (DataFrame)) = (arg1: DataFrame) => {
   // create new_df using arg1 (=DataFrame I pass in parameter)
      new_df    
} 

I get the error:

<console>:32: error: not found: type DataFrame
   val get_nb_previous_offre : ((DataFrame) => (DataFrame)) = (arg1: DataFrame) => {

Is there a librairy I have to import to use DataFrame as a type for my function?

1 Answer 1

5

Yes you need to import this type :

import org.apache.spark.sql.DataFrame
Sign up to request clarification or add additional context in comments.

1 Comment

Alternativly this comon Scala syntax also works: import org.apache.spark.sql.{DataFrame} . Also for anyone coming here and previously coding in PySpark, make sure to stick to camel case convention to avoid exception.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.