Package org.apache.tajo.catalog

Examples of org.apache.tajo.catalog.Schema


  @Test
  /**
   * It verifies NTA-807
   */
  public void testRangeToQueryTest() throws UnsupportedEncodingException {
    Schema schema = new Schema();
    schema.addColumn("l_returnflag", Type.TEXT);
    schema.addColumn("l_linestatus", Type.TEXT);
    Tuple s = new VTuple(2);
    s.put(0, DatumFactory.createText("A"));
    s.put(1, DatumFactory.createText("F"));
    Tuple e = new VTuple(2);
    e.put(0, DatumFactory.createText("R"));
View Full Code Here


public class TestNullValues {

  @Test
  public final void testIsNull() throws Exception {
    String [] table = new String[] {"nulltable1"};
    Schema schema = new Schema();
    schema.addColumn("col1", Type.INT4);
    schema.addColumn("col2", Type.TEXT);
    schema.addColumn("col3", Type.FLOAT4);
    Schema [] schemas = new Schema[] {schema};
    String [] data = {
        "1|filled|0.1",
        "2||",
        "3|filled|0.2"
View Full Code Here

  }

  @Test
  public final void testIsNotNull() throws Exception {
    String [] table = new String[] {"nulltable2"};
    Schema schema = new Schema();
    schema.addColumn("col1", Type.INT4);
    schema.addColumn("col2", Type.TEXT);
    Schema [] schemas = new Schema[] {schema};
    String [] data = {
        "1|filled|",
        "||",
        "3|filled|"
View Full Code Here

  }

  @Test
  public final void testIsNotNull2() throws Exception {
    String [] table = new String[] {"nulltable3"};
    Schema schema = new Schema();
    schema.addColumn("col1", Type.INT8);
    schema.addColumn("col2", Type.INT8);
    schema.addColumn("col3", Type.INT8);
    schema.addColumn("col4", Type.INT8);
    schema.addColumn("col5", Type.INT8);
    schema.addColumn("col6", Type.INT8);
    schema.addColumn("col7", Type.INT8);
    schema.addColumn("col8", Type.INT8);
    schema.addColumn("col9", Type.INT8);
    schema.addColumn("col10", Type.INT8);
    Schema [] schemas = new Schema[] {schema};
    String [] data = {
        ",,,,672287821,1301460,1,313895860387,126288907,1024",
        ",,,43578,19,13,6,3581,2557,1024"
    };
View Full Code Here

  }

  @Test
  public final void testIsNotNull3() throws Exception {
    String [] table = new String[] {"nulltable4"};
    Schema schema = new Schema();
    schema.addColumn("col1", Type.INT8);
    schema.addColumn("col2", Type.INT8);
    schema.addColumn("col3", Type.INT8);
    schema.addColumn("col4", Type.INT8);
    schema.addColumn("col5", Type.INT8);
    schema.addColumn("col6", Type.INT8);
    schema.addColumn("col7", Type.INT8);
    schema.addColumn("col8", Type.INT8);
    schema.addColumn("col9", Type.INT8);
    schema.addColumn("col10", Type.INT8);
    Schema [] schemas = new Schema[] {schema};
    String [] data = {
        "\\N,,,,672287821,",
        ",\\N,,43578"
    };
View Full Code Here

  /**
   * It verify overflow and increment.
   */
  @Test
  public void testIncrement1() {
    Schema schema = new Schema()
    .addColumn("l_returnflag", Type.TEXT)
    .addColumn("l_linestatus", Type.TEXT);
    Tuple s = new VTuple(2);
    s.put(0, DatumFactory.createText("A"));
    s.put(1, DatumFactory.createText("A"));
View Full Code Here

  /**
   * It verify overflow with the number that exceeds the last digit.
   */
  @Test
  public void testIncrement2() {
    Schema schema = new Schema()
    .addColumn("l_returnflag", Type.TEXT)
    .addColumn("l_linestatus", Type.TEXT);
    Tuple s = new VTuple(2);
    s.put(0, DatumFactory.createText("A"));
    s.put(1, DatumFactory.createText("A"));
View Full Code Here

  /**
   * It verify the case where two or more digits are overflow.
   */
  @Test
  public void testIncrement3() {
    Schema schema = new Schema()
    .addColumn("l_returnflag", Type.TEXT)
    .addColumn("l_linestatus", Type.TEXT)
    .addColumn("final", Type.TEXT);

    Tuple s = new VTuple(3);
View Full Code Here

    assertEquals("A", overflowed.get(2).asChars());
  }

  @Test
  public void testIncrement4() {
    Schema schema = new Schema()
    .addColumn("l_orderkey", Type.INT8)
    .addColumn("l_linenumber", Type.INT8);
    Tuple s = new VTuple(2);
    s.put(0, DatumFactory.createInt8(10));
    s.put(1, DatumFactory.createInt8(20));
View Full Code Here

    assertEquals(19, range3.get(0).asInt4());
    assertEquals(39, range3.get(1).asInt4());
  }

  @Test public void testIncrement5() {
    Schema schema = new Schema()
    .addColumn("l_orderkey", Type.INT8)
    .addColumn("l_linenumber", Type.INT8)
    .addColumn("final", Type.INT8);
    Tuple s = new VTuple(3);
    s.put(0, DatumFactory.createInt8(1));
View Full Code Here

TOP

Related Classes of org.apache.tajo.catalog.Schema

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.