Skip to content

Commit

Permalink
[native] add a test case for text reader
Browse files Browse the repository at this point in the history
  • Loading branch information
mshang816 committed Nov 6, 2023
1 parent 8a0da75 commit f0bd6a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion presto-native-execution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<configuration>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<excludedGroups>remote-function</excludedGroups>
<excludedGroups>remote-function,textfile_reader</excludedGroups>
<systemPropertyVariables>
<PRESTO_SERVER>/root/project/build/debug/presto_cpp/main/presto_server</PRESTO_SERVER>
<DATA_DIR>/tmp/velox</DATA_DIR>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -992,13 +992,23 @@ private String generateRandomTableName()
return tableName;
}

@Test
public void testReadTableWithUnsupportedFormats()
@Test(groups = {"no_json_reader"})
public void testReadTableWithUnsupportedJsonFormat()
{
assertQueryFails("SELECT * FROM nation_json", ".*ReaderFactory is not registered for format json.*");
}

@Test(groups = {"no_textfile_reader"})
public void testReadTableWithUnsupportedTextfileFormat()
{
assertQueryFails("SELECT * FROM nation_text", ".*ReaderFactory is not registered for format text.*");
}

@Test(groups = {"textfile_reader"})
public void testReadTableWithTextfileFormat()
{
assertQuery("SELECT * FROM nation_text");
}
private void dropTableIfExists(String tableName)
{
// An ugly workaround for the lack of getExpectedQueryRunner()
Expand Down

0 comments on commit f0bd6a5

Please sign in to comment.