gokceni commented on a change in pull request #1021:
URL: https://github.com/apache/phoenix/pull/1021#discussion_r545466225
##########
File path:
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ViewIndexIT.java
##########
@@ -458,6 +457,116 @@ public void testMultiTenantViewGlobalIndex() throws
Exception {
}
}
+ @Test
+ public void testRowKeyComposition() throws Exception {
+ // For this test we are mapping isNamespaceEnabled to immutable,
multitenant table
+
+ try (Connection conn = DriverManager.getConnection(getUrl())) {
+ // View fixed, index variable
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, INT1",
"TEXT1");
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, INT1,
TEXT4", "TEXT1");
+
+ // Variable lens in the middle. Both end with fixed
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, TEXT1,
TEXT3, INT1",
+ "TEXT1, TEXT4, EMAIL1 DESC, DATE_TIME1 DESC, DOUBLE1");
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, TEXT1,
TEXT3, INT1",
+ "TEXT1, TEXT4, EMAIL1, DATE_TIME1 DESC, DOUBLE1");
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, TEXT1, INT1",
+ "TEXT1, DATE_TIME1 DESC, DOUBLE1");
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, TEXT1, INT1",
+ "TEXT1, DATE_TIME1 DESC, INT1, DOUBLE1");
+
+ // index ends with fix length, data var length
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, INT1,
EMAIL1",
+ "TEXT1, DATE_TIME1 DESC, DOUBLE1");
+
+ // Desc separators
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, INT1",
"TEXT1 DESC");
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, INT1 DESC",
"TEXT1 DESC");
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1, INT1 DESC",
"TEXT1");
+ createTableForRowKeyTestsAndVerify(conn,"DATE_TIME1, TEXT3 DESC,
INT1 DESC, TEXT2 DESC, TEXT4 DESC", "TEXT1 DESC, DOUBLE1 DESC");
+ createTableForRowKeyTestsAndVerify(conn, "DATE_TIME1 DESC, TEXT3
DESC, INT1, DOUBLE1 DESC", "TEXT1");
Review comment:
You cannot create a view with fixed with nullable pk. It returns error.
": PK columns may not be both fixed width and nullable: DATE_TIME2"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]