Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3993,7 +3993,7 @@ private void testDataMapping(DataMappingTestSetup dataMappingTestSetup)
// TODO test with both CTAS *and* CREATE TABLE + INSERT, since they use different connector API methods.
String createTable = "" +
"CREATE TABLE " + tableName + " AS " +
"SELECT CAST(row_id AS varchar(50)) row_id, CAST(value AS " + trinoTypeName + ") value " +
"SELECT CAST(row_id AS varchar(50)) row_id, CAST(value AS " + trinoTypeName + ") value, CAST(value AS " + trinoTypeName + ") another_column " +
"FROM (VALUES " +
" ('null value', NULL), " +
" ('sample value', " + sampleValueLiteral + "), " +
Expand Down Expand Up @@ -4028,6 +4028,9 @@ private void testDataMapping(DataMappingTestSetup dataMappingTestSetup)
assertQuery("SELECT row_id FROM " + tableName + " WHERE value IS NULL OR value > " + sampleValueLiteral, "VALUES 'null value', 'high value'");
assertQuery("SELECT row_id FROM " + tableName + " WHERE value IS NULL OR value <= " + highValueLiteral, "VALUES 'null value', 'sample value', 'high value'");

// complex condition, one that cannot be represented with a TupleDomain
assertQuery("SELECT row_id FROM " + tableName + " WHERE value = " + sampleValueLiteral + " OR another_column = " + sampleValueLiteral, "VALUES 'sample value'");
Comment thread
hashhar marked this conversation as resolved.
Outdated

assertUpdate("DROP TABLE " + tableName);
}

Expand Down Expand Up @@ -4068,6 +4071,7 @@ private List<DataMappingTestSetup> testDataMappingSmokeTestData()
.add(new DataMappingTestSetup("char(3)", "'ab'", "'zzz'"))
.add(new DataMappingTestSetup("varchar(3)", "'de'", "'zzz'"))
.add(new DataMappingTestSetup("varchar", "'łąka for the win'", "'ŻŻŻŻŻŻŻŻŻŻ'"))
.add(new DataMappingTestSetup("varchar", "'a \\backslash'", "'a a'")) // `a` sorts after `\`
.add(new DataMappingTestSetup("varbinary", "X'12ab3f'", "X'ffffffffffffffffffff'"))
.build();
}
Expand Down