tkhurana commented on code in PR #1712:
URL: https://github.com/apache/phoenix/pull/1712#discussion_r1399830551


##########
phoenix-core/src/main/java/org/apache/phoenix/iterate/NonAggregateRegionScannerFactory.java:
##########
@@ -109,13 +113,27 @@ public RegionScanner getRegionScanner(final Scan scan, 
final RegionScanner s) th
         PTable.QualifierEncodingScheme encodingScheme = 
EncodedColumnsUtil.getQualifierEncodingScheme(scan);
         boolean useNewValueColumnQualifier = 
EncodedColumnsUtil.useNewValueColumnQualifier(scan);
 
-        Set<KeyValueColumnExpression> arrayKVRefs = Sets.newHashSet();
+        Set<KeyValueColumnExpression> serverParsedKVRefs = Sets.newHashSet();
         KeyValueSchema kvSchema = null;
         ValueBitSet kvSchemaBitSet = null;
-        Expression[] arrayFuncRefs = 
deserializeArrayPositionalExpressionInfoFromScan(scan, innerScanner, 
arrayKVRefs);
-        if (arrayFuncRefs != null) {
-            KeyValueSchema.KeyValueSchemaBuilder builder = new 
KeyValueSchema.KeyValueSchemaBuilder(0);
-            for (Expression expression : arrayFuncRefs) {
+        Expression[]
+                serverParsedArrayFuncRefs = null;
+        if (scan.getAttribute(BaseScannerRegionObserver.SPECIFIC_ARRAY_INDEX) 
!= null) {
+            serverParsedArrayFuncRefs =
+                    
deserializeServerParsedPositionalExpressionInfoFromScan(scan,
+                            BaseScannerRegionObserver.SPECIFIC_ARRAY_INDEX, 
serverParsedKVRefs);
+        }
+        List<Expression> resultList = new ArrayList<>();
+        if (serverParsedArrayFuncRefs != null) {
+            Collections.addAll(resultList, serverParsedArrayFuncRefs);
+        }
+        extractJsonSpecificFuncRefs(scan, serverParsedKVRefs, resultList);
+        Expression[] serverParsedFuncRefs = resultList.toArray(new 
Expression[0]);

Review Comment:
   Maybe you could combine all these into a single function which extracts all 
the func refs. That will make the code more readable.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to