@@ -0,0 +1,832 @@
+%0Aimport org.apache.spark.sql.Dataset;%0Aimport org.apache.spark.sql.Row;%0Aimport org.apache.spark.sql.RowFactory;%0Aimport org.apache.spark.sql.SparkSession;%0Aimport org.apache.spark.sql.types.DataTypes;%0Aimport org.apache.spark.sql.types.StructType;%0A%0Apublic class Test %7B%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        // create nested row with nested structtype.%0A        Row row = RowFactory.create(%22a%22, RowFactory.create(1,2));%0A        StructType schema = new StructType()%0A                .add(%22f1%22, DataTypes.StringType)%0A                .add(%22f2%22, new StructType()%0A                    .add(%22f3%22, DataTypes.IntegerType)%0A                    .add(%22f4%22, DataTypes.IntegerType));%0A        Dataset%3CRow%3E ds = SparkSession.builder().getOrCreate().createDataFrame(Arrays.asList(row), schema);%0A%0A        ds.show();%0A    %7D%0A %7D%0A

Create nested_row.java