简体   繁体   中英

Define function in scala using DataFrame type

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?

是的,您需要导入以下类型:

import org.apache.spark.sql.DataFrame

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM