converter
>> implicit def convertListToMyList(list: List): MyList {
>>
>> ….
>> }
>>
>> when you do
>> List("apple","orange","cherry").toDF("fruit")
>>
>>
>>
>> Internally, Sca
y, Scala will generate the code as
> convertListToMyList(List("apple","orange","cherry")).toDF("fruit")
>
>
>
>
>
> *From: *Bitfox
> *Date: *Wednesday, March 16, 2022 at 12:06 AM
> *To: *"user @spark"
> *Subject: *[EXTER
quot;,"cherry").toDF("fruit")
Internally, Scala will generate the code as
convertListToMyList(List("apple","orange","cherry")).toDF("fruit")
From: Bitfox
Date: Wednesday, March 16, 2022 at 12:06 AM
To: "user @spark"
I am wondering why the list in scala spark can be converted into a
dataframe directly?
scala> val df = List("apple","orange","cherry").toDF("fruit")
*df*: *org.apache.spark.sql.DataFrame* = [fruit: string]
scala> df.show
+--+
| fruit|
+--+
| apple|
|orange|
|cherry|
+--+
I