You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by arina-ielchiieva <gi...@git.apache.org> on 2018/03/01 10:31:30 UTC
[GitHub] drill pull request #1138: DRILL-4120: Allow implicit columns for Avro storag...
Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/1138#discussion_r171517376
--- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/store/avro/AvroFormatTest.java ---
@@ -170,25 +169,35 @@ public void testSimplePrimitiveSchema_SelectColumnSubset() throws Exception {
@Test
public void testSimplePrimitiveSchema_NoColumnsExistInTheSchema() throws Exception {
- final String file = generateSimplePrimitiveSchema_NoNullValues().getFileName();
- try {
- test("select h_dummy1, e_dummy2 from dfs.`%s`", file);
- Assert.fail("Test should fail as h_dummy1 and e_dummy2 does not exist.");
- } catch(UserException ue) {
- Assert.assertTrue("Test should fail as h_dummy1 and e_dummy2 does not exist.",
- ue.getMessage().contains("Column 'h_dummy1' not found in any table"));
- }
+ final String file = generateSimplePrimitiveSchema_NoNullValues(1).getFileName();
+ testBuilder()
+ .sqlQuery("select h_dummy1, e_dummy2 from dfs.`%s`", file)
+ .unOrdered()
+ .baselineColumns("h_dummy1", "e_dummy2")
+ .baselineValues(null, null)
+ .go();
}
@Test
public void testSimplePrimitiveSchema_OneExistAndOneDoesNotExistInTheSchema() throws Exception {
- final String file = generateSimplePrimitiveSchema_NoNullValues().getFileName();
- try {
- test("select h_boolean, e_dummy2 from dfs.`%s`", file);
- Assert.fail("Test should fail as e_dummy2 does not exist.");
- } catch(UserException ue) {
- Assert.assertTrue("Test should fail as e_dummy2 does not exist.", true);
- }
+ final String file = generateSimplePrimitiveSchema_NoNullValues(1).getFileName();
+ testBuilder()
+ .sqlQuery("select h_boolean, e_dummy2 from dfs.`%s`", file)
+ .unOrdered()
+ .baselineColumns("h_boolean", "e_dummy2")
+ .baselineValues(true, null)
+ .go();
+ }
+
+ @Test
+ public void testImplicitColumnFilename() throws Exception {
+ final String file = generateSimplePrimitiveSchema_NoNullValues(1).getFileName();
+ testBuilder()
+ .sqlQuery("select filename from dfs.`%s`", file)
--- End diff --
Please test all implicit columns and at least one partition column.
---