Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to display pivoted scala rdd?

How to display pivoted scala rdd?

New Contributor

Trying to display pivoted RRD with Scala, either directly or by converting to dataframe. However, take(), toDF(), and show all produce similar errors - not a member of org.apache.spark.sql.GroupedData import org.apache.spark.sql.SQLContext._

val meterdata = sqlContext.read.format("com.databricks.spark.csv").option("delimiter", ",").option("header", "false").load("/CBIES/meters/")

val meters = meterdata.groupBy("C0").pivot("C1")

meters.toDF meters.take(10).foreach(println)

<console>:71: error: value toDF is not a member of org.apache.spark.sql.GroupedData

error: value take is not a member of org.apache.spark.sql.GroupedData

<console>:83: error: value show is not a member of org.apache.spark.sql.GroupedData error: value toDF is not a member of org.apache.spark.sql.GroupedData

1 REPLY 1

Re: How to display pivoted scala rdd?

Contributor