catalog.createTablespace(DEFAULT_TABLESPACE_NAME, context.getConf().getVar(ConfVars.WAREHOUSE_DIR)); } else { LOG.info(String.format("Default tablespace (%s) is already prepared.", DEFAULT_TABLESPACE_NAME));
catalog.createTablespace(DEFAULT_TABLESPACE_NAME, context.getConf().getVar(ConfVars.WAREHOUSE_DIR)); } else { LOG.info(String.format("Default tablespace (%s) is already prepared.", DEFAULT_TABLESPACE_NAME));
@BeforeClass public static void setUp() throws Exception { cluster = new TajoTestingCluster(); conf = cluster.getConfiguration(); cluster.startCatalogCluster(); cat = cluster.getCatalogService(); cat.createTablespace(DEFAULT_TABLESPACE_NAME, "hdfs://localhost:1234/warehouse"); cat.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); Map<FunctionSignature, FunctionDesc> map = FunctionLoader.loadBuiltinFunctions(); List<FunctionDesc> list = new ArrayList<>(map.values()); list.addAll(FunctionLoader.loadUserDefinedFunctions(conf).orElse(new ArrayList<>())); // load Hive UDFs URL hiveUDFURL = ClassLoader.getSystemResource("hiveudf"); Preconditions.checkNotNull(hiveUDFURL, "hive udf directory is absent."); conf.set(TajoConf.ConfVars.HIVE_UDF_JAR_DIR.varname, hiveUDFURL.toString().substring("file:".length())); list.addAll(HiveFunctionLoader.loadHiveUDFs(conf).orElse(new ArrayList<>())); for (FunctionDesc funcDesc : list) { cat.createFunction(funcDesc); } analyzer = new SQLAnalyzer(); preLogicalPlanVerifier = new PreLogicalPlanVerifier(cat); planner = new LogicalPlanner(cat, TablespaceManager.getInstance()); optimizer = new LogicalOptimizer(cluster.getConfiguration(), cat, TablespaceManager.getInstance()); annotatedPlanVerifier = new LogicalPlanVerifier(); }
catalog = util.getCatalogService(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf.setVar(TajoConf.ConfVars.WORKER_TEMPORAL_DIR, testDir.toString());
catalog = util.getCatalogService(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf.setVar(TajoConf.ConfVars.WORKER_TEMPORAL_DIR, testDir.toString());
@Test public final void testAlterLocation() throws Exception { if (!testingCluster.isHiveCatalogStoreRunning()) { ////////////////////////////////////////////////////////////////////////////// // Create two table spaces ////////////////////////////////////////////////////////////////////////////// assertFalse(catalog.existTablespace("space1")); catalog.createTablespace("space1", "hdfs://xxx.com/warehouse"); assertTrue(catalog.existTablespace("space1")); // pre verification CatalogProtos.TablespaceProto space1 = catalog.getTablespace("space1"); assertEquals("space1", space1.getSpaceName()); assertEquals("hdfs://xxx.com/warehouse", space1.getUri()); executeString("ALTER TABLESPACE space1 LOCATION 'hdfs://yyy.com/warehouse';"); // Verify ALTER TABLESPACE space1 space1 = catalog.getTablespace("space1"); assertEquals("space1", space1.getSpaceName()); assertEquals("hdfs://yyy.com/warehouse", space1.getUri()); catalog.dropTablespace("space1"); assertFalse(catalog.existTablespace("space1")); } } }
util.startCatalogCluster(); catalog = util.getCatalogService(); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, "hdfs://localhost:1234/warehouse"); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); for (FunctionDesc funcDesc : FunctionLoader.findLegacyFunctions()) {
@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); }
@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()); }
util.startCatalogCluster(); catalog = util.getCatalogService(); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, "hdfs://localhost:1234/warehouse"); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
sm = TablespaceManager.getLocalFs(); catalog = util.getCatalogService(); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); for (FunctionDesc funcDesc : FunctionLoader.findLegacyFunctions()) {
catalog.createFunction(funcDesc); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, "hdfs://localhost:1234/warehouse"); catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
catalog = util.getCatalogService(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf = util.getConfiguration();
catalog = util.getCatalogService(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf = util.getConfiguration();
util.startCatalogCluster(); catalog = util.getCatalogService(); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, "hdfs://localhost:1234/warehouse"); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); for (FunctionDesc funcDesc : FunctionLoader.findLegacyFunctions()) {
catalog = util.getCatalogService(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf = util.getConfiguration();
catalog = util.getCatalogService(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf = util.getConfiguration();
util.startCatalogCluster(); catalog = util.getCatalogService(); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, "hdfs://localhost:1234"); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME);
catalog = util.getCatalogService(); Path testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(TajoConstants.DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf = util.getConfiguration();
catalog = util.getCatalogService(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); catalog.createTablespace(DEFAULT_TABLESPACE_NAME, testDir.toUri().toString()); catalog.createDatabase(DEFAULT_DATABASE_NAME, DEFAULT_TABLESPACE_NAME); conf = util.getConfiguration();