Package org.apache.hadoop.zebra.schema.Schema

Examples of org.apache.hadoop.zebra.schema.Schema.ColumnSchema


    parser = new TableSchemaParser(new StringReader(strSch));
    schema = parser.RecordSchema(null);
    System.out.println(schema);

    // test 1st level schema;
    ColumnSchema f1 = schema.getColumn(0);
    Assert.assertEquals("m1", f1.getName());
    Assert.assertEquals(ColumnType.MAP, f1.getType());

    ColumnSchema f2 = schema.getColumn(1);
    Assert.assertEquals("m2", f2.getName());
    Assert.assertEquals(ColumnType.MAP, f2.getType());

    ColumnSchema f3 = schema.getColumn(2);
    Assert.assertEquals("f3", f3.getName());
    Assert.assertEquals(ColumnType.BYTES, f3.getType());

    // test 2nd level schema;
    Schema f1Schema = f1.getSchema();
    ColumnSchema f11 = f1Schema.getColumn(0);
    Assert.assertEquals(ColumnType.MAP, f11.getType());

    Schema f2Schema = f2.getSchema();
    ColumnSchema f21 = f2Schema.getColumn(0);
    Assert.assertEquals(ColumnType.BOOL, f21.getType());

    // test 3rd level schema;
    Schema f11Schema = f11.getSchema();
    ColumnSchema f111 = f11Schema.getColumn(0);
    Assert.assertEquals(ColumnType.FLOAT, f111.getType());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.zebra.schema.Schema.ColumnSchema

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.