priyankporwal commented on a change in pull request #735: PHOENIX-5734 - 
IndexScrutinyTool should not report rows beyond maxLoo…
URL: https://github.com/apache/phoenix/pull/735#discussion_r395864325
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
 ##########
 @@ -1183,6 +1186,22 @@ public static int getIsNullableInt(boolean isNullable) {
                return isNullable ? ResultSetMetaData.columnNullable : 
ResultSetMetaData.columnNoNulls;
        }
 
+       public static int getTimeToLive(PhoenixConnection conn, String 
physicalName) throws SQLException {
+        byte[] tableQualifier = Bytes.toBytes(physicalName);
+        return getTimeToLive(conn, tableQualifier);
+    }
+
+    public static int getTimeToLive(PhoenixConnection conn, byte[] 
tableQualifier)
+     throws SQLException {
+        HTableDescriptor td = 
conn.getQueryServices().getTableDescriptor(tableQualifier);
+        HColumnDescriptor[] cds = td.getColumnFamilies();
+        if (cds.length > 0){
+            return cds[0].getTimeToLive();
+        } else {
+            return HConstants.FOREVER;
 
 Review comment:
    when would this be the case? i.e. #CF==0

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to