get specific row from spark dataframe

前端 未结 9 1705
闹比i
闹比i 2020-12-17 07:58

Is there any alternative for df[100, c(\"column\")] in scala spark data frames. I want to select specific row from a column of spark data frame. for example

9条回答
  •  轮回少年
    2020-12-17 08:14

    This is how I achieved the same in Scala. I am not sure if it is more efficient than the valid answer, but it requires less coding

    val parquetFileDF = sqlContext.read.parquet("myParquetFule.parquet")
    
    val myRow7th = parquetFileDF.rdd.take(7).last
    

提交回复
热议问题