kadirozde commented on a change in pull request #1159:
URL: https://github.com/apache/phoenix/pull/1159#discussion_r590826878



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/iterate/RegionScannerFactory.java
##########
@@ -205,6 +210,22 @@ public boolean nextRaw(List<Cell> result) throws 
IOException {
              */
             IndexUtil.wrapResultUsingOffset(env, result, offset, dataColumns,
                 tupleProjector, dataRegion, indexMaintainer, viewConstants, 
ptr);
+
+            byte[] expBytes = 
scan.getAttribute(BaseScannerRegionObserver.LOCAL_INDEX_FILTER);
+            if (expBytes != null) {
+                ByteArrayInputStream stream = new 
ByteArrayInputStream(expBytes);
+                DataInputStream input = new DataInputStream(stream);
+                Expression extraWhere = 
ExpressionType.values()[WritableUtils.readVInt(input)].newInstance();

Review comment:
       This new instance needs to be created only once. Here, it is created for 
each next. We can create the new instance once at the constructor.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to