@Before public void setUp() throws Exception { testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
@Before public void setUp() throws Exception { testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
@BeforeClass public static void setUpClass() throws Exception { rootFilePath = CommonTestingUtil.getTestDir(); }
@Before public void setUp() throws Exception { testPropertyFile = new Path(CommonTestingUtil.getTestDir(), System.currentTimeMillis() + ".properties"); metricsOutputFile = new Path(CommonTestingUtil.getTestDir(), System.currentTimeMillis() + ".out"); FileOutputStream out = new FileOutputStream(testPropertyFile.toUri().getPath()); out.write("reporter.null=org.apache.tajo.util.metrics.reporter.NullReporter\n".getBytes()); out.write("reporter.file=org.apache.tajo.util.metrics.reporter.MetricsFileScheduledReporter\n".getBytes()); out.write("reporter.console=org.apache.tajo.util.metrics.reporter.MetricsConsoleScheduledReporter\n".getBytes()); out.write("MASTER-JVM.reporters=console\n".getBytes()); out.write("MASTER.reporters=file\n".getBytes()); out.write("test-console-group.reporters=console\n".getBytes()); out.write("test-find-console-group.reporters=console,file\n".getBytes()); out.write(("MASTER.file.filename=" + metricsOutputFile.toUri().getPath() + "\n").getBytes()); out.write("MASTER.file.period=5\n".getBytes()); out.close(); }
@Before public void setUp() throws Exception { conf = new TajoConf(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
@Before public void setUp() throws Exception { conf = new TajoConf(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); localFs = testDir.getFileSystem(conf); }
@Before public void setUp() throws Exception { conf = new TajoConf(); testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
public TestCompressionStorages(String type) throws IOException { this.dataFormat = type; conf = new TajoConf(); conf.setBoolean("hive.exec.orc.zerocopy", true); testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
public TestStorages(String type, boolean splitable, boolean statsable, boolean seekable, boolean internalType) throws IOException { final String TEST_PATH = "target/test-data/TestStorages"; this.dataFormat = type; this.splitable = splitable; this.statsable = statsable; this.seekable = seekable; this.internalType = internalType; conf = new TajoConf(); if (dataFormat.equalsIgnoreCase(BuiltinStorages.RCFILE)) { conf.setInt(RCFile.RECORD_INTERVAL_CONF_STR, 100); } testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); }
@Before public final void setUp() throws Exception { conf = new TajoConf(); path = CommonTestingUtil.getTestDir(); }
@Test public final void testInsertIntoLocationDifferentFSs() throws Exception { Path localPath = CommonTestingUtil.getTestDir(); assertTestInsertIntoLocation(localPath); }
@Test public final void testIgnoreFilesInIntermediateDir() throws Exception { // See - TAJO-1219: Files located in intermediate directories of partitioned table should be ignored // It verifies that Tajo ignores files located in intermediate directories of partitioned table. if (nodeType == NodeType.INSERT) { Path testDir = CommonTestingUtil.getTestDir(); executeString( "CREATE EXTERNAL TABLE testIgnoreFilesInIntermediateDir (col1 int) USING CSV PARTITION BY COLUMN (col2 text) " + "LOCATION '" + testDir + "'"); FileSystem fs = testDir.getFileSystem(conf); FSDataOutputStream fos = fs.create(new Path(testDir, "table1.data")); fos.write("a|b|c".getBytes()); fos.close(); ResultSet res = executeString("select * from testIgnoreFilesInIntermediateDir;"); assertFalse(res.next()); res.close(); } }
@Test public final void testTemporalDirectory() throws IOException, InterruptedException { int delay = 1; deletionService = new DeletionService(1, delay); FileSystem fs = FileSystem.getLocal(new Configuration()); Path tempPath = CommonTestingUtil.getTestDir(); assertTrue(fs.exists(tempPath)); deletionService.delete(tempPath); assertTrue(fs.exists(tempPath)); Thread.sleep(delay * 2 * 1000); assertFalse(fs.exists(tempPath)); } }
@Before public void setup() throws Exception { conf = new TajoConf(); conf.setVar(ConfVars.ROOT_DIR, TEST_PATH); conf.setStrings("tajo.storage.projectable-scanner", "rcfile", "parquet", "avro"); testDir = CommonTestingUtil.getTestDir(TEST_PATH); fs = testDir.getFileSystem(conf); sm = TablespaceManager.getLocalFs(); }
@BeforeClass public static void setUp() throws Exception { cluster = TpchTestBase.getInstance().getTestingCluster(); conf = cluster.getConfiguration(); client = cluster.newTajoClient(); testDir = CommonTestingUtil.getTestDir(); }
@Before public void setUp() throws Exception { CommonTestingUtil.getTestDir(TEST_DATA); CommonTestingUtil.getTestDir(INPUT_DIR); CommonTestingUtil.getTestDir(OUTPUT_DIR); conf.setVar(TajoConf.ConfVars.WORKER_TEMPORAL_DIR, INPUT_DIR); conf.setIntVar(TajoConf.ConfVars.SHUFFLE_FETCHER_READ_TIMEOUT, 1); conf.setIntVar(TajoConf.ConfVars.SHUFFLE_FETCHER_CHUNK_MAX_SIZE, 127); if (pullServerType.equals(PullServerType.TAJO)) { pullServerService = new TajoPullServerService(); } else { pullServerService = new org.apache.tajo.yarn.TajoPullServerService(); } pullServerService.init(conf); pullServerService.start(); if (pullServerType.equals(PullServerType.TAJO)) { pullserverPort = ((TajoPullServerService)pullServerService).getPort(); } else { pullserverPort = ((org.apache.tajo.yarn.TajoPullServerService)pullServerService).getPort(); } }
@Test public final void testEnforceForDefaultColumnPartitionStorePlan() throws IOException, TajoException { FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()), Integer.MAX_VALUE); Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testStorePlan"); TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf), LocalTajoTestingUtility.newTaskAttemptId(masterPlan), new FileFragment[] { frags[0] }, workDir); ctx.setEnforcer(new Enforcer()); ctx.setOutputPath(new Path(workDir, "grouped3")); Expr context = analyzer.parse(CreateTableAsStmts[2]); LogicalPlan plan = planner.createPlan(defaultContext, context); LogicalNode rootNode = optimizer.optimize(plan); PhysicalPlanner phyPlanner = new PhysicalPlannerImpl(conf); PhysicalExec exec = phyPlanner.createPlan(ctx, rootNode); exec.close(); assertTrue(exec instanceof SortBasedColPartitionStoreExec); }
@Test public final void testEnforceForHashBasedColumnPartitionStorePlan() throws IOException, TajoException { Expr context = analyzer.parse(CreateTableAsStmts[2]); LogicalPlan plan = planner.createPlan(defaultContext, context); LogicalRootNode rootNode = (LogicalRootNode) optimizer.optimize(plan); CreateTableNode createTableNode = rootNode.getChild(); Enforcer enforcer = new Enforcer(); enforcer.enforceColumnPartitionAlgorithm(createTableNode.getPID(), ColumnPartitionAlgorithm.HASH_PARTITION); FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()), Integer.MAX_VALUE); Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testStorePlan"); TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf), LocalTajoTestingUtility.newTaskAttemptId(masterPlan), new FileFragment[] { frags[0] }, workDir); ctx.setEnforcer(enforcer); ctx.setOutputPath(new Path(workDir, "grouped4")); PhysicalPlanner phyPlanner = new PhysicalPlannerImpl(conf); PhysicalExec exec = phyPlanner.createPlan(ctx, rootNode); exec.close(); assertTrue(exec instanceof HashBasedColPartitionStoreExec); }
@Test public final void testEnforceForSortBasedColumnPartitionStorePlan() throws IOException, TajoException { Expr context = analyzer.parse(CreateTableAsStmts[2]); LogicalPlan plan = planner.createPlan(defaultContext, context); LogicalRootNode rootNode = (LogicalRootNode) optimizer.optimize(plan); CreateTableNode createTableNode = rootNode.getChild(); Enforcer enforcer = new Enforcer(); enforcer.enforceColumnPartitionAlgorithm(createTableNode.getPID(), ColumnPartitionAlgorithm.SORT_PARTITION); FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()), Integer.MAX_VALUE); Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testStorePlan"); TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf), LocalTajoTestingUtility.newTaskAttemptId(masterPlan), new FileFragment[] { frags[0] }, workDir); ctx.setEnforcer(enforcer); ctx.setOutputPath(new Path(workDir, "grouped5")); PhysicalPlanner phyPlanner = new PhysicalPlannerImpl(conf); PhysicalExec exec = phyPlanner.createPlan(ctx, rootNode); exec.close(); assertTrue(exec instanceof SortBasedColPartitionStoreExec); }
@Test public final void testGroupByWithNullValue() throws IOException, TajoException { FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()), Integer.MAX_VALUE); Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testGroupByWithNullValue"); TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf), LocalTajoTestingUtility.newTaskAttemptId(masterPlan), new FileFragment[] { frags[0] }, workDir); ctx.setEnforcer(new Enforcer()); Expr context = analyzer.parse(QUERIES[11]); LogicalPlan plan = planner.createPlan(defaultContext, context); LogicalNode rootNode = optimizer.optimize(plan); PhysicalPlanner phyPlanner = new PhysicalPlannerImpl(conf); PhysicalExec exec = phyPlanner.createPlan(ctx, rootNode); int count = 0; exec.init(); while(exec.next() != null) { count++; } exec.close(); assertEquals(10, count); }