Package org.apache.tajo.catalog

Examples of org.apache.tajo.catalog.Schema.addColumn()


  }

  public static Schema sortSpecsToSchema(SortSpec[] sortSpecs) {
    Schema schema = new Schema();
    for (SortSpec spec : sortSpecs) {
      schema.addColumn(spec.getSortKey());
    }

    return schema;
  }
View Full Code Here


 
  public static Schema getSchemaByTargets(Schema inputSchema, Target [] targets)
      throws InternalException {
    Schema schema = new Schema();
    for (Target target : targets) {
      schema.addColumn(
          target.hasAlias() ? target.getAlias() : target.getEvalTree().getName(),
          getDomainByExpr(inputSchema, target.getEvalTree()));
    }
   
    return schema;
View Full Code Here

  @Test
  public final void testGetScannerAndAppender() throws IOException {
    Schema schema = new Schema();
    schema.addColumn("id", TajoDataTypes.Type.INT4);
    schema.addColumn("age", TajoDataTypes.Type.INT4);
    schema.addColumn("name", TajoDataTypes.Type.TEXT);

    TableMeta meta = CatalogUtil.newTableMeta(schema, CatalogProtos.StoreType.CSV);

    Tuple[] tuples = new Tuple[4];
View Full Code Here

  @Test
  public final void testGetScannerAndAppender() throws IOException {
    Schema schema = new Schema();
    schema.addColumn("id", TajoDataTypes.Type.INT4);
    schema.addColumn("age", TajoDataTypes.Type.INT4);
    schema.addColumn("name", TajoDataTypes.Type.TEXT);

    TableMeta meta = CatalogUtil.newTableMeta(schema, CatalogProtos.StoreType.CSV);

    Tuple[] tuples = new Tuple[4];
    for(int i=0; i < tuples.length; i++) {
View Full Code Here

  }

  @Test
  public final void testPartitionFile() throws IOException {
    Schema schema = new Schema();
    schema.addColumn("key", TajoDataTypes.Type.TEXT);
    schema.addColumn("age", TajoDataTypes.Type.INT4);
    schema.addColumn("name", TajoDataTypes.Type.TEXT);

    TableMeta meta = CatalogUtil.newTableMeta(schema, CatalogProtos.StoreType.CSV);
View Full Code Here

  @Test
  public final void testPartitionFile() throws IOException {
    Schema schema = new Schema();
    schema.addColumn("key", TajoDataTypes.Type.TEXT);
    schema.addColumn("age", TajoDataTypes.Type.INT4);
    schema.addColumn("name", TajoDataTypes.Type.TEXT);

    TableMeta meta = CatalogUtil.newTableMeta(schema, CatalogProtos.StoreType.CSV);

View Full Code Here

  @Test
  public final void testPartitionFile() throws IOException {
    Schema schema = new Schema();
    schema.addColumn("key", TajoDataTypes.Type.TEXT);
    schema.addColumn("age", TajoDataTypes.Type.INT4);
    schema.addColumn("name", TajoDataTypes.Type.TEXT);

    TableMeta meta = CatalogUtil.newTableMeta(schema, CatalogProtos.StoreType.CSV);


    Path path = StorageUtil.concatPath(testDir, "testPartitionFile", "table.csv");
View Full Code Here

        columnSet.addAll(EvalTreeUtil.findDistinctRefColumns(t.getEvalTree()));
      }

      for (Column column : inSchema.getColumns()) {
        if (columnSet.contains(column)) {
          projected.addColumn(column);
        }
      }
    } else {
      projected = outSchema;
    }
View Full Code Here

   
  @Test
  public void testSplitable() throws IOException {
    if (splitable) {
      Schema schema = new Schema();
      schema.addColumn("id", Type.INT4);
      schema.addColumn("age", Type.INT8);

      TableMeta meta = CatalogUtil.newTableMeta(schema, storeType);
      Path tablePath = new Path(testDir, "Splitable.data");
      Appender appender = StorageManagerFactory.getStorageManager(conf).getAppender(meta, tablePath);
View Full Code Here

  @Test
  public void testSplitable() throws IOException {
    if (splitable) {
      Schema schema = new Schema();
      schema.addColumn("id", Type.INT4);
      schema.addColumn("age", Type.INT8);

      TableMeta meta = CatalogUtil.newTableMeta(schema, storeType);
      Path tablePath = new Path(testDir, "Splitable.data");
      Appender appender = StorageManagerFactory.getStorageManager(conf).getAppender(meta, tablePath);
      appender.enableStats();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.