Package org.apache.hadoop.zebra.types

Examples of org.apache.hadoop.zebra.types.CGSchema


      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
View Full Code Here


      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];

      ColumnSchema f11 = cgs1.getSchema().getColumn(0);
      Assert.assertEquals("c", f11.getName());
      Assert.assertEquals(ColumnType.COLLECTION, f11.getType());

      ColumnSchema f21 = cgs2.getSchema().getColumn(0);
      Assert.assertEquals("m1", f21.getName());
      Assert.assertEquals(ColumnType.MAP, f21.getType());

      Assert.assertEquals(cgs1.getCompressor(), "gz");
      Assert.assertEquals(cgs2.getSerializer(), "avro");

      System.out.println("*********** Column Map **********");
      Map<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>> colmap = p
          .getPartitionInfo().getColMap();
      Assert.assertEquals(colmap.size(), 2);
View Full Code Here

      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("c", f11.getName());
      Assert.assertEquals(ColumnType.COLLECTION, f11.getType());

      ColumnSchema f21 = cgs2.getSchema().getColumn(0);
      Assert.assertEquals("m1", f21.getName());
      Assert.assertEquals(ColumnType.MAP, f21.getType());

      ColumnSchema f31 = cgs3.getSchema().getColumn(0);
      Assert.assertEquals("m1", f31.getName());
      Assert.assertEquals(ColumnType.MAP, f31.getType());

      System.out.println("*********** Column Map **********");
      Map<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>> colmap = p
View Full Code Here

        fs.delete(path, true);
      }

      checkPath(path, true);

      cgschema = new CGSchema(schema, sorted, comparator, name, serializer, compressor, owner, group, perm);
      CGSchema sfNew = CGSchema.load(fs, path);
      if (sfNew != null) {
        // compare input with on-disk schema.
        if (!sfNew.equals(cgschema)) {
          throw new IOException("Schemes are different.");
        }
      }
      else {
        // create the schema file in FS
View Full Code Here

     */

    public static Schema getSchema(Path path, Configuration conf)
        throws IOException, ParseException {
      FileSystem fs = path.getFileSystem(conf);
      CGSchema cgschema = CGSchema.load(fs, path);
      return cgschema.getSchema();
    }
View Full Code Here

     */

    public static Schema getSchema(Path path, Configuration conf)
        throws IOException, ParseException {
      FileSystem fs = path.getFileSystem(conf);
      CGSchema cgschema = CGSchema.load(fs, path);
      return cgschema.getSchema();
    }
View Full Code Here

        fs.delete(path, true);
      }

      checkPath(path, true);

      cgschema = new CGSchema(schema, sorted, serializer, compressor);
      CGSchema sfNew = CGSchema.load(fs, path);
      if (sfNew != null) {
        // compare input with on-disk schema.
        if (!sfNew.equals(cgschema)) {
          throw new IOException("Schemes are different.");
        }
      }
      else {
        // create the schema file in FS
View Full Code Here

      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.name);
      Assert.assertEquals(ColumnType.INT, f11.type);
      ColumnSchema f12 = cgs1.getSchema().getColumn(1);
      Assert.assertEquals("r.f2", f12.name);
      Assert.assertEquals(ColumnType.MAP, f12.type);

      ColumnSchema f21 = cgs2.getSchema().getColumn(0);
      Assert.assertEquals("r.r.f2", f21.name);
      Assert.assertEquals(ColumnType.INT, f21.type);
      ColumnSchema f22 = cgs2.getSchema().getColumn(1);
      Assert.assertEquals("r.f2", f22.name);
      Assert.assertEquals(ColumnType.MAP, f22.type);

      ColumnSchema f31 = cgs3.getSchema().getColumn(0);
      Assert.assertEquals("r.f2", f31.name);
      Assert.assertEquals(ColumnType.MAP, f31.type);

      System.out.println("*********** Column Map **********");
      Map<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>> colmap = p
View Full Code Here

      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];

      ColumnSchema f11 = cgs1.getSchema().getColumn(0);
      Assert.assertEquals("c", f11.name);
      Assert.assertEquals(ColumnType.COLLECTION, f11.type);

      ColumnSchema f21 = cgs2.getSchema().getColumn(0);
      Assert.assertEquals("m1", f21.name);
      Assert.assertEquals(ColumnType.MAP, f21.type);

      Assert.assertEquals(cgs1.getCompressor(), "gzip");
      Assert.assertEquals(cgs2.getSerializer(), "avro");

      System.out.println("*********** Column Map **********");
      Map<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>> colmap = p
          .getPartitionInfo().getColMap();
      Assert.assertEquals(colmap.size(), 2);
View Full Code Here

      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("c", f11.name);
      Assert.assertEquals(ColumnType.COLLECTION, f11.type);

      ColumnSchema f21 = cgs2.getSchema().getColumn(0);
      Assert.assertEquals("m1", f21.name);
      Assert.assertEquals(ColumnType.MAP, f21.type);

      ColumnSchema f31 = cgs3.getSchema().getColumn(0);
      Assert.assertEquals("m1", f31.name);
      Assert.assertEquals(ColumnType.MAP, f31.type);

      System.out.println("*********** Column Map **********");
      Map<String, HashSet<Partition.PartitionInfo.ColumnMappingEntry>> colmap = p
View Full Code Here

TOP

Related Classes of org.apache.hadoop.zebra.types.CGSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.