Use a `.`: hc.sql("select _1.item_id from agg_imps_df limit 10").collect()
On Tue, Nov 10, 2015 at 11:24 AM, pratik khadloya <tispra...@gmail.com> wrote: > 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 >