How to upload custom visualization to Oracle DV server version
http://HOSTNAME:7780/dv/ui/home.jsp?consoletab=customPluginsTab&pageid=console
Notes on the cuff
SparkSession ss = SparkSession.builder().appName("JavaALSExample").master("local[*]").getOrCreate();
Dataset dsout = ss.read().format("parquet").load("hdfs://spark16/user/gollum/ads_par_clear").as(Encoders.bean(AdsFrame.class));
dsout.printSchema();
dsout.show();
StructType libsvmSchema = new StructType().add("label", "double").add("features", new VectorUDT());
Dataset dsLibsvm = ss.createDataFrame(
dsout.javaRDD().map(new Function() {
public Row call(AdsFrame a) {
Double label = (double) 0;
Vector currentRow = Vectors.dense(a.getAlti(), a.getLati(), a.getLongi(), a.getSpeed(), a.getTrck() );
return RowFactory.create(label, currentRow);
}
}),
libsvmSchema);
DataFrame reslt = sqlContext.createDataFrame(
srcDatafr.javaRDD().map(row -> {
return RowFactory.create(row.get(0), row.get(1), row.get(2), "You value", row.get(4) );
}), srcDatafr.schema());
reslt.printSchema();
reslt.show();
}