Apache-Phoenix | 5.1 | HBase 2.4 | Build #245 SUCCESS
5.1 branch HBase 2.4 build #245 status SUCCESS Build #245 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/245/
Apache-Phoenix | 5.1 | HBase 2.3 | Build #245 SUCCESS
5.1 branch HBase 2.3 build #245 status SUCCESS Build #245 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/245/
Apache-Phoenix | 5.1 | HBase 2.5 | Build #245 FAILURE
5.1 branch HBase 2.5 build #245 status FAILURE Build #245 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/245/
Apache-Phoenix | master | HBase 2.5 | Build #552 SUCCESS
master branch HBase 2.5 build #552 status SUCCESS Build #552 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/552/
Apache-Phoenix | master | HBase 2.4 | Build #552 FAILURE
master branch HBase 2.4 build #552 status FAILURE Build #552 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/552/
Apache-Phoenix | 5.1 | HBase 2.2 | Build #245 FAILURE
5.1 branch HBase 2.2 build #245 status FAILURE Build #245 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/245/
Apache-Phoenix | 5.1 | HBase 2.1 | Build #245 FAILURE
5.1 branch HBase 2.1 build #245 status FAILURE Build #245 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/245/
[phoenix] branch 5.1 updated: PHOENIX-6999 Point lookups fail with reverse scan (#1646)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/5.1 by this push: new fa449378ce PHOENIX-6999 Point lookups fail with reverse scan (#1646) fa449378ce is described below commit fa449378cebe59bc3d85296e7594234452a5ee6e Author: Istvan Toth AuthorDate: Wed Jul 26 09:27:30 2023 +0200 PHOENIX-6999 Point lookups fail with reverse scan (#1646) --- .../org/apache/phoenix/end2end/BaseOrderByIT.java | 55 +- .../java/org/apache/phoenix/util/ScanUtil.java | 38 ++- 2 files changed, 58 insertions(+), 35 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOrderByIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOrderByIT.java index b9de4ee2b7..a0ef9bdb72 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOrderByIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOrderByIT.java @@ -38,6 +38,7 @@ import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Statement; import java.util.Properties; import org.apache.phoenix.compile.ExplainPlan; @@ -46,6 +47,8 @@ import org.apache.phoenix.jdbc.PhoenixPreparedStatement; import org.apache.phoenix.thirdparty.com.google.common.collect.Lists; import org.apache.phoenix.util.PropertiesUtil; import org.apache.phoenix.util.QueryBuilder; +import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.TestUtil; import org.junit.Test; @@ -86,7 +89,6 @@ public abstract class BaseOrderByIT extends ParallelStatsDisabledIT { } } - @Test public void testDescMultiOrderByExpr() throws Exception { String tenantId = getOrganizationId(); @@ -996,4 +998,55 @@ public abstract class BaseOrderByIT extends ParallelStatsDisabledIT { } } +@Test +public void testPhoenix6999() throws Exception { +Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); +String tableName = "TBL_" + generateUniqueName(); +String descTableName = "TBL_" + generateUniqueName(); + +String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); +String fullDescTableName = +SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, descTableName); + +try (Connection conn = DriverManager.getConnection(getUrl(), props); +Statement stmt = conn.createStatement()) { +conn.setAutoCommit(false); +String ddl = +"CREATE TABLE " + fullTableName ++ "(k1 varchar primary key, v1 varchar, v2 varchar)"; +stmt.execute(ddl); +ddl = +"CREATE TABLE " + fullDescTableName ++ "(k1 varchar primary key desc, v1 varchar, v2 varchar)"; +stmt.execute(ddl); +stmt.execute("upsert into " + fullTableName + " values ('a','a','a')"); +stmt.execute("upsert into " + fullTableName + " values ('b','b','b')"); +stmt.execute("upsert into " + fullTableName + " values ('c','c','c')"); +stmt.execute("upsert into " + fullDescTableName + " values ('a','a','a')"); +stmt.execute("upsert into " + fullDescTableName + " values ('b','b','b')"); +stmt.execute("upsert into " + fullDescTableName + " values ('c','c','c')"); +conn.commit(); + +String query = "SELECT * from " + fullTableName + " where k1='b' order by k1 asc"; +ResultSet rs = stmt.executeQuery(query); +assertTrue(rs.next()); +assertEquals("b", rs.getString(1)); + +query = "SELECT * from " + fullTableName + " where k1='b' order by k1 desc"; +rs = stmt.executeQuery(query); +assertTrue(rs.next()); +assertEquals("b", rs.getString(1)); + +query = "SELECT * from " + fullDescTableName + " where k1='b' order by k1 asc"; +rs = stmt.executeQuery(query); +assertTrue(rs.next()); +assertEquals("b", rs.getString(1)); + +query = "SELECT * from " + fullDescTableName + " where k1='b' order by k1 desc"; +rs = stmt.executeQuery(query); +assertTrue(rs.next()); +assertEquals("b", rs.getString(1)); +} +} + } \ No newline at end of file diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java index 24c14dd6ca..09114f4b97 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java @@ -112,14 +112,6 @@ public class ScanUtil { public
[phoenix] branch master updated: PHOENIX-6999 Point lookups fail with reverse scan (#1646)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/master by this push: new 694f8444ce PHOENIX-6999 Point lookups fail with reverse scan (#1646) 694f8444ce is described below commit 694f8444ce3bd67e4fb0e2deb40a8d36f82dfd60 Author: Istvan Toth AuthorDate: Wed Jul 26 09:27:30 2023 +0200 PHOENIX-6999 Point lookups fail with reverse scan (#1646) --- .../org/apache/phoenix/end2end/BaseOrderByIT.java | 55 +- .../java/org/apache/phoenix/util/ScanUtil.java | 38 ++- 2 files changed, 58 insertions(+), 35 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOrderByIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOrderByIT.java index b9de4ee2b7..a0ef9bdb72 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOrderByIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOrderByIT.java @@ -38,6 +38,7 @@ import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Statement; import java.util.Properties; import org.apache.phoenix.compile.ExplainPlan; @@ -46,6 +47,8 @@ import org.apache.phoenix.jdbc.PhoenixPreparedStatement; import org.apache.phoenix.thirdparty.com.google.common.collect.Lists; import org.apache.phoenix.util.PropertiesUtil; import org.apache.phoenix.util.QueryBuilder; +import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.TestUtil; import org.junit.Test; @@ -86,7 +89,6 @@ public abstract class BaseOrderByIT extends ParallelStatsDisabledIT { } } - @Test public void testDescMultiOrderByExpr() throws Exception { String tenantId = getOrganizationId(); @@ -996,4 +998,55 @@ public abstract class BaseOrderByIT extends ParallelStatsDisabledIT { } } +@Test +public void testPhoenix6999() throws Exception { +Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); +String tableName = "TBL_" + generateUniqueName(); +String descTableName = "TBL_" + generateUniqueName(); + +String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName); +String fullDescTableName = +SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, descTableName); + +try (Connection conn = DriverManager.getConnection(getUrl(), props); +Statement stmt = conn.createStatement()) { +conn.setAutoCommit(false); +String ddl = +"CREATE TABLE " + fullTableName ++ "(k1 varchar primary key, v1 varchar, v2 varchar)"; +stmt.execute(ddl); +ddl = +"CREATE TABLE " + fullDescTableName ++ "(k1 varchar primary key desc, v1 varchar, v2 varchar)"; +stmt.execute(ddl); +stmt.execute("upsert into " + fullTableName + " values ('a','a','a')"); +stmt.execute("upsert into " + fullTableName + " values ('b','b','b')"); +stmt.execute("upsert into " + fullTableName + " values ('c','c','c')"); +stmt.execute("upsert into " + fullDescTableName + " values ('a','a','a')"); +stmt.execute("upsert into " + fullDescTableName + " values ('b','b','b')"); +stmt.execute("upsert into " + fullDescTableName + " values ('c','c','c')"); +conn.commit(); + +String query = "SELECT * from " + fullTableName + " where k1='b' order by k1 asc"; +ResultSet rs = stmt.executeQuery(query); +assertTrue(rs.next()); +assertEquals("b", rs.getString(1)); + +query = "SELECT * from " + fullTableName + " where k1='b' order by k1 desc"; +rs = stmt.executeQuery(query); +assertTrue(rs.next()); +assertEquals("b", rs.getString(1)); + +query = "SELECT * from " + fullDescTableName + " where k1='b' order by k1 asc"; +rs = stmt.executeQuery(query); +assertTrue(rs.next()); +assertEquals("b", rs.getString(1)); + +query = "SELECT * from " + fullDescTableName + " where k1='b' order by k1 desc"; +rs = stmt.executeQuery(query); +assertTrue(rs.next()); +assertEquals("b", rs.getString(1)); +} +} + } \ No newline at end of file diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java index c02acd9379..658d48402b 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java @@ -121,14 +121,6 @@ public class ScanUtil {