Skip to content

Commit

Permalink
Move testRequiresQueryPartitionFilterWithUppercaseColumnName
Browse files Browse the repository at this point in the history
The integration test is sufficient.
  • Loading branch information
ebyhr committed Aug 31, 2023
1 parent 163d762 commit 5ceb83d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,35 @@ public void testWriterAfterRenameColumnWithColumnMappingMode(String columnMappin
assertUpdate("DROP TABLE " + tableName);
}

/**
* @see deltalake.case_sensitive
*/
@Test
public void testRequiresQueryPartitionFilterWithUppercaseColumnName()
throws Exception
{
String tableName = "test_require_partition_filter_" + randomNameSuffix();
Path tableLocation = Files.createTempFile(tableName, null);
copyDirectoryContents(new File(Resources.getResource("deltalake/case_sensitive").toURI()).toPath(), tableLocation);

assertUpdate("CALL system.register_table('%s', '%s', '%s')".formatted(getSession().getSchema().orElseThrow(), tableName, tableLocation.toUri()));
assertQueryReturnsEmptyResult("SELECT * FROM " + tableName);

assertUpdate("INSERT INTO " + tableName + " VALUES (1, 11), (2, 22)", 2);

assertQuery("SELECT * FROM " + tableName, "VALUES (1, 11), (2, 22)");

Session session = Session.builder(getSession())
.setCatalogSessionProperty(getSession().getCatalog().orElseThrow(), "query_partition_filter_required", "true")
.build();

assertQuery(format("SELECT * FROM %s WHERE \"part\" = 11", tableName), "VALUES (1, 11)");
assertQuery(format("SELECT * FROM %s WHERE \"PART\" = 11", tableName), "VALUES (1, 11)");
assertQuery(format("SELECT * FROM %s WHERE \"Part\" = 11", tableName), "VALUES (1, 11)");

assertUpdate("DROP TABLE " + tableName);
}

/**
* @see deltalake.case_sensitive
*/
Expand Down

This file was deleted.

0 comments on commit 5ceb83d

Please sign in to comment.