Re: how to select the first row in each group by group?

2015-01-12 Thread Silvio Fiorito
ache.org<mailto:u...@spark.incubator.apache.org>" mailto:u...@spark.incubator.apache.org>> Subject: how to select the first row in each group by group? Hi all: I am using spark sql to read and write hive tables. But There is a issue that how to select the first row in each group by group? In hive, we

how to select the first row in each group by group?

2015-01-12 Thread LinQili
Hi all:I am using spark sql to read and write hive tables. But There is a issue that how to select the first row in each group by group?In hive, we could write hql like this:SELECT imeiFROM (SELECT imei, row_number() over (PARTITION BY imei ORDER BY login_time ASC