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



##########
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:
       @swaroopak Switched to using an existing helper function to get the 
millisecond version of the max lookback config. 




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