Package org.apache.hadoop.zebra.parser

Examples of org.apache.hadoop.zebra.parser.TableSchemaParser$JJCalls


public class TestSchemaMap {
  @Test
  public void testSchemaValid1() throws ParseException {
    String strSch = "f1:int, m1:map(int)";
    TableSchemaParser parser;
    Schema schema;

    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("f1", f1.getName());
View Full Code Here


  }

  @Test
  public void testSchemaValid2() throws ParseException {
    String strSch = "f1:int, m1:map(map(float))";
    TableSchemaParser parser;
    Schema schema;

    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("f1", f1.getName());
View Full Code Here

  }

  @Test
  public void testSchemaValid3() throws ParseException {
    String strSch = "m1:map(map(float)), m2:map(bool), f3";
    TableSchemaParser parser;
    Schema schema;

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

  @Test
  public void testSchemaInvalid1() throws ParseException {
    try {
      String strSch = "m1:abc";
      TableSchemaParser parser;
      Schema schema;

      parser = new TableSchemaParser(new StringReader(strSch));
      schema = parser.RecordSchema(null);
      System.out.println(schema);
    } catch (Exception e) {
      String errMsg = e.getMessage();
      String str = "Encountered \" <IDENTIFIER> \"abc \"\" at line 1, column 4.";
      System.out.println(errMsg);
View Full Code Here

  @Test
  public void testSchemaInvalid2() throws ParseException {
    try {
      String strSch = "m1:map(int";
      TableSchemaParser parser;
      Schema schema;

      parser = new TableSchemaParser(new StringReader(strSch));
      schema = parser.RecordSchema(null);
      System.out.println(schema);
    } catch (Exception e) {
      String errMsg = e.getMessage();
      String str = "Encountered \"<EOF>\" at line 1, column 10.";
      System.out.println(errMsg);
View Full Code Here

  @Test
  public void testSchemaInvalid3() throws ParseException {
    try {
      String strSch = "m1:map(int, f2:int";
      TableSchemaParser parser;
      Schema schema;

      parser = new TableSchemaParser(new StringReader(strSch));
      schema = parser.RecordSchema(null);
      System.out.println(schema);
    } catch (Exception e) {
      String errMsg = e.getMessage();
      String str = "Encountered \" \",\" \", \"\" at line 1, column 11.";
      System.out.println(errMsg);
View Full Code Here

  @Test
  public void testSchemaInvalid4() throws ParseException {
    try {
      String strSch = "m1:map(m2:int)";
      TableSchemaParser parser;
      Schema schema;

      parser = new TableSchemaParser(new StringReader(strSch));
      schema = parser.RecordSchema(null);
      System.out.println(schema);
    } catch (Exception e) {
      String errMsg = e.getMessage();
      String str = "Encountered \" <IDENTIFIER> \"m2 \"\" at line 1, column 8.";
      System.out.println(errMsg);
View Full Code Here

  @Test
  public void testSchemaInvalid5() throws ParseException {
    try {
      String strSch = "m1:map(abc)";
      TableSchemaParser parser;
      Schema schema;

      parser = new TableSchemaParser(new StringReader(strSch));
      schema = parser.RecordSchema(null);
      System.out.println(schema);
    } catch (Exception e) {
      String errMsg = e.getMessage();
      String str = "Encountered \" <IDENTIFIER> \"abc \"\" at line 1, column 8.";
      System.out.println(errMsg);
View Full Code Here

   * ctor used by STORE
   */
  public Partition(final String schema, final String storage, String comparator, String sortColumns)
        throws ParseException, IOException
  {
    TableSchemaParser parser = new TableSchemaParser(new StringReader(schema));
    mSchema = parser.RecordSchema(null);
    mSortInfo = SortInfo.parse(sortColumns, mSchema, comparator);
    mSorted = (mSortInfo != null && mSortInfo.size() > 0);
    this.comparator = (mSorted ? mSortInfo.getComparator() : "");
    storeConst(storage);
  }
View Full Code Here

  }

  public Partition(String schema, final String storage, String comparator)
      throws ParseException, IOException
  {
    TableSchemaParser parser = new TableSchemaParser(new StringReader(schema));
    mSchema = parser.RecordSchema(null);
    this.comparator = comparator;
    storeConst(storage);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.zebra.parser.TableSchemaParser$JJCalls

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.