[
https://issues.apache.org/jira/browse/PHOENIX-4841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16637000#comment-16637000
]
Hadoop QA commented on PHOENIX-4841:
------------------------------------
{color:red}-1 overall{color}. Here are the results of testing the latest
attachment
http://issues.apache.org/jira/secure/attachment/12942259/PHOENIX-4841.patch
against master branch at commit ecb6bc995c478f2d58df093b48421564449c38b2.
ATTACHMENT ID: 12942259
{color:green}+1 @author{color}. The patch does not contain any @author
tags.
{color:red}-1 tests included{color}. The patch doesn't appear to include
any new or modified tests.
Please justify why no new tests are needed for this
patch.
Also please list what manual steps were performed to
verify this patch.
{color:green}+1 javac{color}. The applied patch does not increase the
total number of javac compiler warnings.
{color:red}-1 release audit{color}. The applied patch generated 1 release
audit warnings (more than the master's current 0 warnings).
{color:red}-1 lineLengths{color}. The patch introduces the following lines
longer than 100:
+ "INCLUDE (CREATED_BY, RELATIONSHIP_ID, JSON1, DOUBLE1,
IS_BOOLEAN, IP_START_ADDRESS, CREATED_DATE, SYSTEM_MODSTAMP, TEXT_READ_ONLY)");
+ stmt.execute("CREATE VIEW IF NOT EXISTS " + tenantView + " AS
SELECT * FROM " + fullViewName );
+ viewConn.createStatement().execute("UPSERT INTO " + tenantView +
"(DATE_TIME1, TEXT1, TEXT2) VALUES (TO_DATE('2017-10-16 22:00:00', 'yyyy-MM-dd
HH:mm:ss'), 'd', '1')");
+ viewConn.createStatement().execute("UPSERT INTO " + tenantView +
"(DATE_TIME1, TEXT1, TEXT2) VALUES (TO_DATE('2017-10-16 22:00:00', 'yyyy-MM-dd
HH:mm:ss'), 'c', '2')");
+ viewConn.createStatement().execute("UPSERT INTO " + tenantView +
"(DATE_TIME1, TEXT1, TEXT2) VALUES (TO_DATE('2017-10-16 22:00:00', 'yyyy-MM-dd
HH:mm:ss'), 'b', '3')");
+ viewConn.createStatement().execute("UPSERT INTO " + tenantView +
"(DATE_TIME1, TEXT1, TEXT2) VALUES (TO_DATE('2017-10-16 22:00:00', 'yyyy-MM-dd
HH:mm:ss'), 'b', '4')");
+ viewConn.createStatement().execute("UPSERT INTO " + tenantView +
"(DATE_TIME1, TEXT1, TEXT2) VALUES (TO_DATE('2017-10-16 22:00:00', 'yyyy-MM-dd
HH:mm:ss'), 'a', '4')");
+ ResultSet rsE = stmt.executeQuery("EXPLAIN SELECT TEXT1, TEXT2
FROM " + tenantView + " WHERE (TEXT1, TEXT2) > ('b', '3') ORDER BY TEXT1 DESC,
TEXT2");
+ ResultSet rs = stmt.executeQuery("SELECT TEXT1, TEXT2 FROM " +
tenantView + " WHERE (TEXT1, TEXT2) > ('b', '3') ORDER BY TEXT1 DESC, TEXT2");
+ "SELECT TEXT1, TEXT2 FROM " + fullViewName + " WHERE
(TEXT1, TEXT2) > ('b', '3') ORDER BY TEXT1 DESC, TEXT2");
{color:red}-1 core tests{color}. The patch failed these unit tests:
./phoenix-core/target/failsafe-reports/TEST-org.apache.phoenix.end2end.UpsertSelectAutoCommitIT
./phoenix-core/target/failsafe-reports/TEST-org.apache.phoenix.tx.TransactionIT
./phoenix-core/target/failsafe-reports/TEST-org.apache.phoenix.end2end.SortOrderIT
./phoenix-core/target/failsafe-reports/TEST-org.apache.phoenix.end2end.index.MutableIndexSplitForwardScanIT
./phoenix-core/target/failsafe-reports/TEST-org.apache.phoenix.end2end.ConcurrentMutationsIT
./phoenix-core/target/failsafe-reports/TEST-org.apache.phoenix.end2end.index.MutableIndexSplitReverseScanIT
Test results:
https://builds.apache.org/job/PreCommit-PHOENIX-Build/2069//testReport/
Release audit warnings:
https://builds.apache.org/job/PreCommit-PHOENIX-Build/2069//artifact/patchprocess/patchReleaseAuditWarnings.txt
Console output:
https://builds.apache.org/job/PreCommit-PHOENIX-Build/2069//console
This message is automatically generated.
> Filters that uses RVC with pk columns where with DESC sort order don't work
> correctly
> -------------------------------------------------------------------------------------
>
> Key: PHOENIX-4841
> URL: https://issues.apache.org/jira/browse/PHOENIX-4841
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.15.0, 5.1.0
> Reporter: Thomas D'Silva
> Assignee: Daniel Wong
> Priority: Major
> Labels: DESC
> Attachments: PHOENIX-4841.patch
>
>
> If we filter on pk columns where one of the columns is DESC, we don't get the
> expected results. If the PK columns are of sorted by ASC we get the correct
> results. For eg. the following test fails:
> {code}
> @Test
> public void testRVCWithDescAndAscPK() throws Exception {
> String fullTableName = generateUniqueName();
> // create base table and global view using global connection
> try (Connection conn = DriverManager.getConnection(getUrl())) {
> Statement stmt = conn.createStatement();
> stmt.execute("CREATE TABLE " + fullTableName + "(\n" +
> " A VARCHAR NOT NULL,\n" +
> " B VARCHAR NOT NULL,\n" +
> " C VARCHAR NOT NULL,\n" +
> " CONSTRAINT PK PRIMARY KEY (A, B DESC, C))");
>
> conn.createStatement().execute("UPSERT INTO " + fullTableName + "
> VALUES ('x', 'd', '1')");
> conn.createStatement().execute("UPSERT INTO " + fullTableName + "
> VALUES ('x', 'c', '2')");
> conn.createStatement().execute("UPSERT INTO " + fullTableName + "
> VALUES ('x', 'b', '3')");
> conn.createStatement().execute("UPSERT INTO " + fullTableName + "
> VALUES ('x', 'b', '4')");
> conn.createStatement().execute("UPSERT INTO " + fullTableName + "
> VALUES ('x', 'a', '4')");
> conn.commit();
> }
> // validate that running query using global view gives same results
> try (Connection conn = DriverManager.getConnection(getUrl())) {
> ResultSet rs =
> conn.createStatement().executeQuery(
> "SELECT B, C FROM " + fullTableName + " WHERE (B, C)
> > ('b', '3')");
> assertTrue(rs.next());
> assertEquals("d", rs.getString(1));
> assertEquals("1", rs.getString(2));
> assertTrue(rs.next());
> assertEquals("c", rs.getString(1));
> assertEquals("2", rs.getString(2));
> assertTrue(rs.next());
> assertEquals("b", rs.getString(1));
> assertEquals("4", rs.getString(2));
> assertFalse(rs.next());
> }
> }
> {code}
> The comparison expression for the above query is
> {code}
> (PK[-1], PK[-1]) > (TO_VARCHAR('b'), '3')
> {code}
> When the first row is evaluated the lhs bytes is:
> {code}
> [-101, -1, 49]
> {code}
> and rhs bytes:
> {code}
> [-99, -1, 51]
> {code}
> We invert the bytes of the B column but since the greater than comparison
> operator usedthe row is filtered out (even though it should be returned).
> [~jamestaylor]
> When a column is DESC order do we need to rewrite the comparison expression?
> Instead of
> {code}
> WHERE (B, C) > ('b', '3')
> {code}
> we need something like
> {code}
> WHERE B<~'b' OR (B=~'b' AND C>'3')
> {code}
> Is there a better way to handle this?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)