gjacoby126 commented on a change in pull request #857:
URL: https://github.com/apache/phoenix/pull/857#discussion_r473348976



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
##########
@@ -172,6 +178,28 @@ public QueryPlan compile() throws SQLException{
         return plan;
     }
 
+    private void verifySCN() throws SQLException {
+        if (!HbaseCompatCapabilities.isMaxLookbackTimeSupported()) {
+            return;
+        }
+        PhoenixConnection conn = statement.getConnection();
+        Long scn = conn.getSCN();
+        if (scn == null) {
+            return;
+        }
+        ColumnResolver resolver =
+            FromCompiler.getResolverForQuery(select, conn);
+        int maxLookBackAge = conn.getQueryServices().
+            
getConfiguration().getInt(CompatBaseScannerRegionObserver.PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY,
+            CompatBaseScannerRegionObserver.DEFAULT_PHOENIX_MAX_LOOKBACK_AGE);
+        long now = EnvironmentEdgeManager.currentTimeMillis();
+        if (maxLookBackAge > 0 && now - maxLookBackAge * 1000L > scn){

Review comment:
       Not sure I follow? The configuration property is in seconds (to 
correspond with HBase TTL, which is also in seconds), but we convert to ms in 
the if-block to compare with the current timestamp. 




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


Reply via email to