Package org.apache.tajo.engine.planner.logical

Examples of org.apache.tajo.engine.planner.logical.InsertNode


    } else {
      meta = CatalogUtil.newTableMeta(plan.getStorageType());
    }

    if (plan instanceof InsertNode) {
      InsertNode createTableNode = (InsertNode) plan;
      appender = StorageManagerFactory.getStorageManager(context.getConf()).getAppender(meta,
          createTableNode.getTableSchema(), context.getOutputPath());
    } else {
      appender = StorageManagerFactory.getStorageManager(context.getConf()).getAppender(meta, outSchema,
          context.getOutputPath());
    }
View Full Code Here


    for (int i = 0; i < keyNum; i++) {
      Column column = this.plan.getPartitionMethod().getExpressionSchema().getColumn(i);
      keyNames[i] = column.getSimpleName();

      if (this.plan.getType() == NodeType.INSERT) {
        InsertNode insertNode = ((InsertNode)plan);
        int idx = insertNode.getTableSchema().getColumnId(column.getQualifiedName());
        keyIds[i] = idx;
      } else if (this.plan.getType() == NodeType.CREATE_TABLE) {
        CreateTableNode createTable = (CreateTableNode) plan;
        int idx = createTable.getLogicalSchema().getColumnId(column.getQualifiedName());
        keyIds[i] = idx;
View Full Code Here

        CatalogService catalog = context.getWorkerContext().getCatalog();
        SubQuery lastStage = query.getSubQuery(finalExecBlockId);
        TableMeta meta = lastStage.getTableMeta();
        TableStats stats = lastStage.getResultStats();

        InsertNode insertNode = (InsertNode) lastStage.getBlock().getPlan();

        TableDesc finalTable;
        if (insertNode.hasTargetTable()) {
          String tableName = insertNode.getTableName();
          finalTable = catalog.getTableDesc(tableName);
        } else {
          String tableName = query.getId().toString();
          finalTable = new TableDesc(tableName, lastStage.getSchema(), meta, finalOutputDir);
        }

        long volume = getTableVolume(query.systemConf, finalOutputDir);
        stats.setNumBytes(volume);
        finalTable.setStats(stats);

        if (insertNode.hasTargetTable()) {
          catalog.dropTable(insertNode.getTableName());
          catalog.createTable(finalTable);
        }

        query.setResultDesc(finalTable);
      }
View Full Code Here

TOP

Related Classes of org.apache.tajo.engine.planner.logical.InsertNode

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.