// String strStorage = "[r.r.f1,r.f2#{k1}] COMPRESS BY gzip SECURE BY uid:root group:data perm:966; [r.r.f2, r.f2#{k2}] COMPRESS BY lzo SERIALIZE BY avro";
// String strStorage = "[r.r.f1,r.f2#{k1}] COMPRESS BY gzip SECURE BY; [r.r.f2, r.f2#{k2}] COMPRESS BY lzo SERIALIZE BY avro";
// String strStorage = "[r.r.f1,r.f2#{k1}] COMPRESS BY gzip SECURE BY uid:ggg SECURE BY group:fff; [r.r.f2, r.f2#{k2}] COMPRESS BY lzo SERIALIZE BY avro";
// String strStorage = "[r.r.f1,r.f2#{k1}] COMPRESS BY gzip SECURE BY uid:root user:root; [r.r.f2, r.f2#{k2}] COMPRESS BY lzo SERIALIZE BY avro";
Partition p = new Partition(schema.toString(), strStorage, null);
CGSchema[] cgschemas = p.getCGSchemas();
// 3 column group;
int size = cgschemas.length;
Assert.assertEquals(size, 3);
System.out.println("********** Column Groups **********");
for (int i = 0; i < cgschemas.length; i++) {
System.out.println(cgschemas[i]);
System.out.println("--------------------------------");
}
CGSchema cgs1 = cgschemas[0];
CGSchema cgs2 = cgschemas[1];
CGSchema cgs3 = cgschemas[2];
ColumnSchema f11 = cgs1.getSchema().getColumn(0);
Assert.assertEquals("r.r.f1", f11.getName());
Assert.assertEquals(ColumnType.INT, f11.getType());
ColumnSchema f12 = cgs1.getSchema().getColumn(1);
Assert.assertEquals("r.f2", f12.getName());
Assert.assertEquals(ColumnType.MAP, f12.getType());
ColumnSchema f21 = cgs2.getSchema().getColumn(0);
Assert.assertEquals("r.r.f2", f21.getName());
Assert.assertEquals(ColumnType.INT, f21.getType());
ColumnSchema f22 = cgs2.getSchema().getColumn(1);
Assert.assertEquals("r.f2", f22.getName());
Assert.assertEquals(ColumnType.MAP, f22.getType());
ColumnSchema f31 = cgs3.getSchema().getColumn(0);
Assert.assertEquals("r.f2", f31.getName());
Assert.assertEquals(ColumnType.MAP, f31.getType());
System.out.println("*********** Column Map **********");
Map<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>> colmap = p
.getPartitionInfo().getColMap();
Assert.assertEquals(colmap.size(), 3);
Iterator<Map.Entry<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>>> it = colmap
.entrySet().iterator();
for (int i = 0; i < colmap.size(); i++) {