public DataFrame createJavaSchemaRDD ( ExtractorConfig < Cells > config ) throws UnsupportedDataTypeException , UnsupportedOperationException { JavaRDD < Cells > cellsRDD = createJavaRDD ( config ) ; JavaRDD < Row > rowsRDD = DeepSparkContext . createJavaRowRDD ( cellsRDD ) ; try { Cells firstCells = cellsRDD . first ( ) ; StructType schema = CellsUtils . getStructTypeFromCells ( firstCells ) ; return sqlContext . applySchema ( rowsRDD , schema ) ; } catch ( UnsupportedOperationException e ) { throw new UnsupportedOperationException ( "Cannot infer schema from empty data RDD" , e ) ; } }
Creates a JavaSchemaRDD from a DeepJobConfig and a JavaSQLContext .