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


##########
phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java:
##########
@@ -1770,18 +1768,10 @@ private void 
extractLiteralTTLForInternalScan(MiniBatchOperationInProgress<Mutat
     if (ttlBytes == null) {
       return;
     }
-    // Disambiguate literal vs conditional by the proto discriminator alone 
(hasLiteral()), the same
-    // field TTLExpressionFactory.createFromProto keys on, without 
materializing the compiled
-    // conditional Expression tree just to test its type. This keeps the 
conditional path's cost
-    // unchanged: a conditional _TTL is left in place and only 
updateMutationsForConditionalTTL
-    // deserializes it (per expiring row, as before).
-    if (!PTableProtos.TTLExpression.parseFrom(ttlBytes).hasLiteral()) {
-      // Conditional TTL: leave the attribute in place for 
updateMutationsForConditionalTTL.
-      return;
-    }
-    context.literalTTLForInternalScan = ttlBytes;
-    for (int i = 0; i < miniBatchOp.size(); i++) {
-      
miniBatchOp.getOperation(i).setAttribute(BaseScannerRegionObserverConstants.TTL,
 null);
+    CompiledTTLExpression ttlExpr = TTLExpressionFactory.create(ttlBytes);
+    context.ttlExpressionForBatch = ttlExpr;
+    if (context.isLiteralTTL()) {
+      context.literalTTLForInternalScan = ttlBytes;

Review Comment:
   Do we need a separate field for literal ttl ?



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