I'm trying to create new dataframes using the columns of an initial dataframe (df0).
I tried to create an array of strings to use it for dataset names, but it didn't work.
String [] column = ds.columns();
String [] dsName = new String[10];
int max=ds.schema().length();
for (i=0; i<max; i++) {
Dataset<Row> dsName[i]=null;
for (j=0; j<max && j!=i; j++) {
for (k=0; k<max && k!=i && k!=i; k++) {
dsName[i]= ds.select(ds.col(column[i]),
ds.col(column[j]),
ds.col(column[k]));
}
}
}
Expected result for (initial df0, and 3 dfs df1i):
df11 = df0.select(df0.col("1"),df0.col("2"));
df12 = df0.select(df0.col("1"),df0.col("3"));
df13 = df0.select(df0.col("1"),df0.col("4"));