[
https://issues.apache.org/jira/browse/DRILL-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16381924#comment-16381924
]
ASF GitHub Bot commented on DRILL-4120:
---------------------------------------
Github user vvysotskyi commented on a diff in the pull request:
https://github.com/apache/drill/pull/1138#discussion_r171544478
--- 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 --
Thanks for pointing this, modified existing test to check except the
`filename` also `suffix`, `fqn` and `filepath` implicit columns. Added separate
test for partition column.
> dir0 does not work when the directory structure contains Avro files
> -------------------------------------------------------------------
>
> Key: DRILL-4120
> URL: https://issues.apache.org/jira/browse/DRILL-4120
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Affects Versions: 1.3.0
> Reporter: Stefán Baxter
> Assignee: Volodymyr Vysotskyi
> Priority: Major
> Fix For: 1.13.0
>
> Attachments:
> 0001-DRILL-4120-Support-reading-directories-having-avro-f.patch
>
>
> Any select statment containing dirN fails if the target directory structure
> contains Avro files.
> Steps to test:
> 1. create a simple directory structure
> 2. copy an avro file into each directory
> 3. execute a query containing dir0
> outcome:
> Error: VALIDATION ERROR: From line 1, column 117 to line 1, column 120:
> Column 'dir0' not found in any table
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)