Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/984#discussion_r145294064
--- Diff:
exec/java-exec/src/test/java/org/apache/drill/TestAltSortQueries.java ---
@@ -19,24 +19,33 @@
import org.apache.drill.categories.OperatorTest;
import org.apache.drill.categories.SqlTest;
+import org.apache.drill.test.BaseTestQuery;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@Category({SqlTest.class, OperatorTest.class})
-public class TestAltSortQueries extends BaseTestQuery{
+public class TestAltSortQueries extends BaseTestQuery {
static final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(TestAltSortQueries.class);
+ @BeforeClass
+ public static void setupTestFiles() {
+ dirTestWatcher.copyFileToRoot("sample-data/region.parquet");
+ dirTestWatcher.copyFileToRoot("sample-data/regionsSF");
+ dirTestWatcher.copyFileToRoot("sample-data/nation.parquet");
+ }
+
@Test
public void testOrderBy() throws Exception{
test("select R_REGIONKEY " +
- "from dfs_test.`[WORKING_PATH]/../../sample-data/region.parquet`
" +
+ "from dfs_test.`/sample-data/region.parquet` " +
--- End diff --
I like this improvement. Here we created files just for this one test. You
are using a workspace to point to those files. Do so avoids the need to doctor
up the strings.
Is `dfs_test` setup to point to the per-query root directory? Seems to be.
Since I have to ask these questions, would be good to explain in the
`...drill.test` `package-info.java` file how to set up temporary files and the
mapping of workspaces to these directories. That will allow others to readily
use the mechanism. Otherwise, people will guess, and will go back to using what
is familiar. See `ExampleTest.java` for an example of a "starter" file to help
people get started.
In fact, maybe we would add a new example test to that file that shows how
to create a test-specific data file and query that file. (That would sure help
me...)
---