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 imei FROM ( SELECT imei, row_number() over (PARTITION BY imei ORDER BY login_time ASC) AS row_num FROM login_log_2015010914 ) a WHERE row_num = 1
In spark sql, how to write the sql equal to the hql?