Skip to content

Commit

Permalink
Upgrade Phoenix to 5.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo authored and hashhar committed Apr 20, 2023
1 parent 6cb5e7f commit 65427ba
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/trino-phoenix5-patched/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>org.apache.phoenix</groupId>
<artifactId>phoenix-client-embedded-hbase-2.2</artifactId>
<version>5.1.2</version>
<version>5.1.3</version>
</dependency>

<dependency>
Expand Down
12 changes: 11 additions & 1 deletion plugin/trino-phoenix5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@
</exclusions>
</dependency>

<!-- TODO: This explicit dependency can be removed once we update to Phoenix 5.1.4 which includes
https://github.com/apache/phoenix/commit/cd35c5239bd7e3f263d3f2a99ce1b996205bde4b -->
<!-- Phoenix depends on log4j api and since it's banned, let's use hardened API-compatible fork -->
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.25</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down Expand Up @@ -415,7 +425,7 @@
<dependency>
<groupId>org.apache.phoenix</groupId>
<artifactId>phoenix-client-embedded-hbase-2.2</artifactId>
<version>5.1.2</version>
<version>5.1.3</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ public void testShowCreateTable()
" comment varchar(79)\n" +
")\n" +
"WITH (\n" +
" bloomfilter = 'ROW',\n" +
" data_block_encoding = 'FAST_DIFF',\n" +
" rowkeys = 'ROWKEY',\n" +
" salt_buckets = 10\n" +
Expand Down Expand Up @@ -617,6 +618,7 @@ public void testCreateTableWithProperties()
" d varchar(10)\n" +
")\n" +
"WITH (\n" +
" bloomfilter = 'ROW',\n" +
" data_block_encoding = 'FAST_DIFF',\n" +
" rowkeys = 'A,B,C',\n" +
" salt_buckets = 10\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,21 +386,15 @@ public void testBinary()
{
// Not testing max length (2147483647) because it leads to 'Requested array size exceeds VM limit'
SqlDataTypeTest.create()
.addRoundTrip("binary(1)", "NULL", VARBINARY, "X'00'") // NULL stored as zeros
.addRoundTrip("binary(10)", "DECODE('', 'HEX')", VARBINARY, "X'00000000000000000000'") // empty stored as zeros
.addRoundTrip("binary(1)", "NULL", VARBINARY, "CAST(NULL AS VARBINARY)")
.addRoundTrip("binary(10)", "DECODE('', 'HEX')", VARBINARY, "CAST(NULL AS VARBINARY)")
.addRoundTrip("binary(5)", "DECODE('68656C6C6F', 'HEX')", VARBINARY, "to_utf8('hello')")
.addRoundTrip("binary(26)", "DECODE('5069C4996B6E6120C582C4856B61207720E69DB1E4BAACE983BD', 'HEX')", VARBINARY, "to_utf8('Piękna łąka w 東京都')")
.addRoundTrip("binary(16)", "DECODE('4261672066756C6C206F6620F09F92B0', 'HEX')", VARBINARY, "to_utf8('Bag full of 💰')")
.addRoundTrip("binary(17)", "DECODE('0001020304050607080DF9367AA7000000', 'HEX')", VARBINARY, "X'0001020304050607080DF9367AA7000000'") // non-text
.addRoundTrip("binary(6)", "DECODE('000000000000', 'HEX')", VARBINARY, "X'000000000000'")
.addRoundTrip("integer primary key", "1", INTEGER, "1")
.execute(getQueryRunner(), phoenixCreateAndInsert("tpch.test_binary"));

// Verify 'IS NULL' doesn't get rows where the value is X'00...' padded in Phoenix
try (TestTable table = new TestTable(new PhoenixSqlExecutor(phoenixServer.getJdbcUrl()), "tpch.test_binary", "(null_binary binary(1), empty_binary binary(10), pk integer primary key)", ImmutableList.of("NULL, DECODE('', 'HEX'), 1"))) {
assertQueryReturnsEmptyResult(format("SELECT * FROM %s WHERE null_binary IS NULL", table.getName()));
assertQueryReturnsEmptyResult(format("SELECT * FROM %s WHERE empty_binary IS NULL", table.getName()));
}
}

@Test
Expand Down

0 comments on commit 65427ba

Please sign in to comment.