public static List < Writable > sampleFromColumn ( int count , String columnName , Schema schema , JavaRDD < List < Writable > > data ) { int colIdx = schema . getIndexOfColumn ( columnName ) ; JavaRDD < Writable > ithColumn = data . map ( new SelectColumnFunction ( colIdx ) ) ; return ithColumn . takeSample ( false , count ) ; }
Randomly sample values from a single column