Package org.apache.tajo.catalog

Examples of org.apache.tajo.catalog.TableMeta


  }

  public void init() throws IOException {
    super.init();

    TableMeta meta;
    if (plan.hasOptions()) {
      meta = CatalogUtil.newTableMeta(outSchema, plan.getStorageType(), plan.getOptions());
    } else {
      meta = CatalogUtil.newTableMeta(outSchema, plan.getStorageType());
    }
View Full Code Here


    return appender;
  }


  public TableMeta getTableMeta(Path tablePath) throws IOException {
    TableMeta meta;

    FileSystem fs = tablePath.getFileSystem(conf);
    Path tableMetaPath = new Path(tablePath, ".meta");
    if (!fs.exists(tableMetaPath)) {
      throw new FileNotFoundException(".meta file not found in " + tablePath.toString());
View Full Code Here

    return split(tableName, tablePath, fragmentSize);
  }

  public Fragment[] splitBroadcastTable(Path tablePath) throws IOException {
    FileSystem fs = tablePath.getFileSystem(conf);
    TableMeta meta = getTableMeta(tablePath);
    List<Fragment> listTablets = new ArrayList<Fragment>();
    Fragment tablet;

    FileStatus[] fileLists = fs.listStatus(tablePath);
    for (FileStatus file : fileLists) {
View Full Code Here

  private Fragment[] split(String tableName, Path tablePath, long size)
      throws IOException {
    FileSystem fs = tablePath.getFileSystem(conf);

    TableMeta meta = getTableMeta(tablePath);
    long defaultBlockSize = size;
    List<Fragment> listTablets = new ArrayList<Fragment>();
    Fragment tablet;

    FileStatus[] fileLists = fs.listStatus(tablePath);
View Full Code Here

    catalog = util.getMiniCatalogCluster().getCatalog();
    TPCH tpch = new TPCH();
    tpch.loadSchemas();
    tpch.loadOutSchema();
    for (String table : tpch.getTableNames()) {
      TableMeta m = CatalogUtil.newTableMeta(tpch.getSchema(table), CatalogProtos.StoreType.CSV);
      m.setStat(new TableStat());
      TableDesc d = CatalogUtil.newTableDesc(table, m, CommonTestingUtil.getTestDir());
      catalog.addTable(d);
    }

    analyzer = new SQLAnalyzer();
View Full Code Here

    loadTable(PARTSUPP) ;
    loadTable(SUPPLIER);
  }

  private void loadTable(String tableName) throws ServiceException {
    TableMeta meta = CatalogUtil.newTableMeta(getSchema(tableName), StoreType.CSV);
    meta.putOption(CSVFile.DELIMITER, "|");
    try {
      tajo.createExternalTable(tableName, new Path(dataDir, tableName), meta);
    } catch (SQLException s) {
      throw new ServiceException(s);
    }
View Full Code Here

    return this.plan;
  }

  private void sortAndStoreChunk(int chunkId, List<Tuple> tupleSlots)
      throws IOException {
    TableMeta meta = CatalogUtil.newTableMeta(inSchema, StoreType.RAW);
    Collections.sort(tupleSlots, getComparator());
    // TODO - RawFile requires the local file path.
    // So, I add the scheme 'file:/' to path. But, it should be improved.
    Path localPath = new Path(sortTmpDir + "/0_" + chunkId);
View Full Code Here

      @Override
      public void execute(QueryMaster.QueryMasterContext context, QueryContext queryContext,
                          Query query, ExecutionBlockId finalExecBlockId,
                          Path finalOutputDir) throws Exception {
        SubQuery lastStage = query.getSubQuery(finalExecBlockId);
        TableMeta meta = lastStage.getTableMeta();
        TableStats stats = lastStage.getResultStats();

        TableDesc resultTableDesc =
            new TableDesc(
                query.getId().toString(),
View Full Code Here

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

        CreateTableNode createTableNode = (CreateTableNode) lastStage.getBlock().getPlan();
        TableMeta meta = new TableMeta(createTableNode.getStorageType(), createTableNode.getOptions());

        TableDesc tableDescTobeCreated =
            new TableDesc(
                createTableNode.getTableName(),
                createTableNode.getTableSchema(),
View Full Code Here

                          Query query, ExecutionBlockId finalExecBlockId, Path finalOutputDir)
          throws Exception {

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

TOP

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

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.