[
https://issues.apache.org/jira/browse/PHOENIX-7073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17788131#comment-17788131
]
ASF GitHub Bot commented on PHOENIX-7073:
-----------------------------------------
tkhurana commented on code in PR #1712:
URL: https://github.com/apache/phoenix/pull/1712#discussion_r1399614634
##########
phoenix-core/src/main/java/org/apache/phoenix/iterate/NonAggregateRegionScannerFactory.java:
##########
@@ -232,31 +277,40 @@ static OrderedResultIterator deserializeFromScan(Scan
scan, RegionScanner s,
}
}
- private Expression[] deserializeArrayPositionalExpressionInfoFromScan(Scan
scan, RegionScanner s,
-
Set<KeyValueColumnExpression> arrayKVRefs) {
- byte[] specificArrayIdx =
scan.getAttribute(BaseScannerRegionObserver.SPECIFIC_ARRAY_INDEX);
+ private Expression[]
deserializeServerParsedPositionalExpressionInfoFromScan(Scan scan,
+ String scanAttribute, Set<KeyValueColumnExpression>
serverParsedKVRefs) {
+ byte[] specificArrayIdx = scan.getAttribute(scanAttribute);
if (specificArrayIdx == null) {
return null;
}
ByteArrayInputStream stream = new
ByteArrayInputStream(specificArrayIdx);
try {
DataInputStream input = new DataInputStream(stream);
- int arrayKVRefSize = WritableUtils.readVInt(input);
- for (int i = 0; i < arrayKVRefSize; i++) {
+ int kvRefSize = WritableUtils.readVInt(input);
+ for (int i = 0; i < kvRefSize; i++) {
PTable.ImmutableStorageScheme scheme =
EncodedColumnsUtil.getImmutableStorageScheme(scan);
KeyValueColumnExpression kvExp = scheme !=
PTable.ImmutableStorageScheme.ONE_CELL_PER_COLUMN ? new
SingleCellColumnExpression(scheme)
: new KeyValueColumnExpression();
kvExp.readFields(input);
- arrayKVRefs.add(kvExp);
+ serverParsedKVRefs.add(kvExp);
}
- int arrayKVFuncSize = WritableUtils.readVInt(input);
- Expression[] arrayFuncRefs = new Expression[arrayKVFuncSize];
- for (int i = 0; i < arrayKVFuncSize; i++) {
- ArrayIndexFunction arrayIdxFunc = new ArrayIndexFunction();
- arrayIdxFunc.readFields(input);
- arrayFuncRefs[i] = arrayIdxFunc;
+ int kvFuncSize = WritableUtils.readVInt(input);
+ Expression[] funcRefs = new Expression[kvFuncSize];
+ for (int i = 0; i < kvFuncSize; i++) {
Review Comment:
Is there ever a case where the value of the variable kvFuncSize is > 1 ?
> Parse JSON columns on the server side
> -------------------------------------
>
> Key: PHOENIX-7073
> URL: https://issues.apache.org/jira/browse/PHOENIX-7073
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Ranganath Govardhanagiri
> Assignee: Ranganath Govardhanagiri
> Priority: Major
>
> One of the optimizations mentioned in the Design spec is to _"pass the json
> path to server side as part of the select and do the parsing on the server
> side and then return the result to the client."_
> This is the task to track that change
--
This message was sent by Atlassian Jira
(v8.20.10#820010)