tablePath.toUri()); tableDesc.setStats(stats); util.getMaster().getCatalog().createTable(tableDesc);
IdentifierUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "employee"), schema, employeeMeta, employeePath.toUri()); catalog.createTable(employee); analyzer = new SQLAnalyzer(); planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
catalog.createTable(employee); analyzer = new SQLAnalyzer(); planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
catalog.createTable(desc); LOG.info("relation '" + qualifiedName + "' created."); return desc;
IdentifierUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "employee"), schema, meta, CommonTestingUtil.getTestDir().toUri()); catalog.createTable(people); IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, "dept"), schema2, "TEXT", new KeyValueSet(), CommonTestingUtil.getTestDir().toUri()); catalog.createTable(student); IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, "score"), schema3, "TEXT", new KeyValueSet(), CommonTestingUtil.getTestDir().toUri()); catalog.createTable(score);
@Override public void execute(QueryMaster.QueryMasterContext context, QueryContext queryContext, Query query, ExecutionBlockId finalExecBlockId, Path finalOutputDir) throws Exception { CatalogService catalog = context.getWorkerContext().getCatalog(); Stage lastStage = query.getStage(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(), meta, finalOutputDir.toUri()); tableDescTobeCreated.setExternal(createTableNode.isExternal()); if (createTableNode.hasPartition()) { tableDescTobeCreated.setPartitionMethod(createTableNode.getPartitionMethod()); } if (query.hasUnionPlan()) { TableStats aggregated = query.aggregateTableStatsOfTerminalBlock(); tableDescTobeCreated.setStats(aggregated); } else { stats.setNumBytes(getTableVolume(query.systemConf, finalOutputDir)); tableDescTobeCreated.setStats(stats); } query.setResultDesc(tableDescTobeCreated); catalog.createTable(tableDescTobeCreated); } }
@BeforeClass public static void setUp() throws Exception { util = new TajoTestingCluster(); util.startCatalogCluster(); catalog = util.getCatalogService(); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, "hdfs://localhost:1234"); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); for (FunctionDesc funcDesc : FunctionLoader.findLegacyFunctions()) { catalog.createFunction(funcDesc); } // TPC-H Schema for Complex Queries String [] tpchTables = { "part", "supplier", "partsupp", "nation", "region", "lineitem" }; tpch = new TPCH(); tpch.loadSchemas(); tpch.loadOutSchema(); for (String table : tpchTables) { TableMeta m = CatalogUtil.newTableMeta(BuiltinStorages.TEXT, util.getConfiguration()); TableDesc d = CatalogUtil.newTableDesc( IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, table), tpch.getSchema(table), m, CommonTestingUtil.getTestDir()); catalog.createTable(d); } sqlAnalyzer = new SQLAnalyzer(); planner = new LogicalPlanner(catalog, TablespaceManager.getInstance()); }
@Override public void execute(QueryMaster.QueryMasterContext context, QueryContext queryContext, Query query, ExecutionBlockId finalExecBlockId, Path finalOutputDir) throws Exception { CatalogService catalog = context.getWorkerContext().getCatalog(); Stage lastStage = query.getStage(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(), meta, finalOutputDir.toUri()); tableDescTobeCreated.setExternal(createTableNode.isExternal()); if (createTableNode.hasPartition()) { tableDescTobeCreated.setPartitionMethod(createTableNode.getPartitionMethod()); } if (query.hasUnionPlan()) { TableStats aggregated = query.aggregateTableStatsOfTerminalBlock(); tableDescTobeCreated.setStats(aggregated); } else { stats.setNumBytes(getTableVolume(query.systemConf, finalOutputDir)); tableDescTobeCreated.setStats(stats); } query.setResultDesc(tableDescTobeCreated); catalog.createTable(tableDescTobeCreated); } }
IdentifierUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "employee"), schema, meta, CommonTestingUtil.getTestDir().toUri()); catalog.createTable(people); IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, "dept"), schema2, "TEXT", new KeyValueSet(), CommonTestingUtil.getTestDir().toUri()); catalog.createTable(student); IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, "score"), schema3, "TEXT", new KeyValueSet(), CommonTestingUtil.getTestDir().toUri()); catalog.createTable(score); largeTableStats.setNumBytes(StorageUnit.PB * (i+1)); //1 PB * i largeDept.setStats(largeTableStats); catalog.createTable(largeDept);
CatalogUtil.newTableMeta(BuiltinStorages.TEXT, util.getConfiguration()), CommonTestingUtil.getTestDir().toUri(), true); catalog.createTable(tableDesc); assertTrue(catalog.existsTable("default.self_desc_table1")); tableDesc = catalog.getTableDesc("default.self_desc_table1");
IdentifierUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "employee"), schema, meta, CommonTestingUtil.getTestDir().toUri()); catalog.createTable(people); catalog.createTable(student); catalog.createTable(score); IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, table), tpch.getSchema(table), m, CommonTestingUtil.getTestDir()); catalog.createTable(d);
appender.close(); largeScore.setStats(appender.getStats()); catalog.createTable(largeScore);
@BeforeClass public static void setUp() throws Exception { util = new TajoTestingCluster(); util.startCatalogCluster(); conf = util.getConfiguration(); conf.set(TajoConf.ConfVars.$TEST_BROADCAST_JOIN_ENABLED.varname, "false"); catalog = util.getCatalogService(); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, "hdfs://localhost:!234/warehouse"); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); TPCH tpch = new TPCH(); tpch.loadSchemas(); tpch.loadOutSchema(); for (String table : tpch.getTableNames()) { TableMeta m = CatalogUtil.newTableMeta(BuiltinStorages.TEXT, util.getConfiguration()); TableDesc d = CatalogUtil.newTableDesc( IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, table), tpch.getSchema(table), m, CommonTestingUtil.getTestDir()); TableStats stats = new TableStats(); stats.setNumBytes(TPCH.tableVolumes.get(table)); d.setStats(stats); catalog.createTable(d); } analyzer = new SQLAnalyzer(); logicalPlanner = new LogicalPlanner(catalog, TablespaceManager.getInstance()); optimizer = new LogicalOptimizer(conf, catalog, TablespaceManager.getInstance()); dispatcher = new AsyncDispatcher(); dispatcher.init(conf); dispatcher.start(); planner = new GlobalPlanner(conf, catalog); }
IdentifierUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "employee"), schema, employeeMeta, tablePath.toUri()); catalog.createTable(desc);
IdentifierUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "employee"), schema, meta, CommonTestingUtil.getTestDir().toUri()); catalog.createTable(people); IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, "dept"), schema2, "TEXT", new KeyValueSet(), CommonTestingUtil.getTestDir().toUri()); catalog.createTable(student); IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, "score"), schema3, "TEXT", new KeyValueSet(), CommonTestingUtil.getTestDir().toUri()); catalog.createTable(score);
CatalogUtil.newTableMeta(BuiltinStorages.TEXT, util.getConfiguration()), CommonTestingUtil.getTestDir().toUri(), true); catalog.createTable(tableDesc); assertTrue(catalog.existsTable("default.self_desc_table1")); tableDesc = catalog.getTableDesc("default.self_desc_table1");
IdentifierUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "people"), schema, meta, CommonTestingUtil.getTestDir().toUri()); catalog.createTable(desc);
appender.close(); employee = CatalogUtil.newTableDesc("default.employee", employeeSchema, employeeMeta, employeePath); catalog.createTable(employee); catalog.createTable(people); analyzer = new SQLAnalyzer(); planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
appender.close(); employee1 = CatalogUtil.newTableDesc("default.employee1", employeeSchema1, employeeMeta1, employeePath1); catalog.createTable(employee1); appender2.close(); employee2 = CatalogUtil.newTableDesc("default.employee2", employeeSchema2, employeeMeta2, employeePath2); catalog.createTable(employee2);
appender.close(); employee = CatalogUtil.newTableDesc("default.employee", employeeSchema, employeeMeta, employeePath); catalog.createTable(employee); catalog.createTable(people); analyzer = new SQLAnalyzer(); planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());