This is an automated email from the ASF dual-hosted git repository.
gjacoby pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
new 441f6f1 PHOENIX-5692 - SCN verification breaks with non-default
column families
441f6f1 is described below
commit 441f6f13ada7f8d72902f9b56fa8c2e011e9f042
Author: Geoffrey Jacoby <[email protected]>
AuthorDate: Tue Jan 21 15:50:32 2020 -0800
PHOENIX-5692 - SCN verification breaks with non-default column families
---
phoenix-core/src/it/java/org/apache/phoenix/end2end/SCNIT.java | 2 +-
.../src/main/java/org/apache/phoenix/compile/QueryCompiler.java | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SCNIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SCNIT.java
index d79752e..8512028 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SCNIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SCNIT.java
@@ -143,7 +143,7 @@ public class SCNIT extends ParallelStatsDisabledIT {
try (Connection conn = DriverManager.getConnection(getUrl())) {
conn.createStatement()
.execute(String.format("CREATE TABLE
%s" +
- "(k VARCHAR PRIMARY KEY, v
VARCHAR) %s", fullTableName, ddlOptions));
+ "(k VARCHAR PRIMARY KEY, f.v
VARCHAR) %s", fullTableName, ddlOptions));
conn.createStatement().execute("UPSERT INTO " +
fullTableName + " VALUES('a','aa')");
conn.createStatement().execute("UPSERT INTO " +
fullTableName + " VALUES('b','bb')");
conn.createStatement().execute("UPSERT INTO " +
fullTableName + " VALUES('c','cc')");
diff --git
a/phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
b/phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
index 4722bd6..8afd111 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
@@ -191,10 +191,13 @@ public class QueryCompiler {
//we can have a tableRef with an empty table, such as with
sequences
if (tableQualifier.length > 0) {
HTableDescriptor td =
conn.getQueryServices().getTableDescriptor(tableQualifier);
- HColumnDescriptor cd =
td.getFamily(QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES);
+ HColumnDescriptor[] cds = td.getColumnFamilies();
now = EnvironmentEdgeManager.currentTimeMillis();
- if (now - cd.getTimeToLive() * 1000L > scn) {
- scnTooOldTableRefs.add(tableRef);
+ if (cds.length > 0){
+ //Phoenix only allows a single table level TTL, so any CF
will do
+ if (now - cds[0].getTimeToLive() * 1000L > scn) {
+ scnTooOldTableRefs.add(tableRef);
+ }
}
}
}