Hello,

I just saved a PairRDD as a table, but i am not able to query it correctly.
The below and other variations does not seem to work.

scala> hc.sql("select * from agg_imps_df").printSchema()
 |-- _1: struct (nullable = true)
 |    |-- item_id: long (nullable = true)
 |    |-- flight_id: long (nullable = true)
 |-- _2: struct (nullable = true)
 |    |-- day_hour: string (nullable = true)
 |    |-- imps: long (nullable = true)
 |    |-- revenue: double (nullable = true)


scala> hc.sql("select _1:item_id from agg_imps_df limit 10").collect()


Can anyone please suggest the correct way to get the list of item_ids in
the query?

Thanks,
~Pratik

Reply via email to