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


##########
phoenix-core-client/src/main/java/org/apache/phoenix/schema/PTable.java:
##########


Review Comment:
   Make the "UNKNOWN is never persisted" invariant self-enforcing. Right now 
it's only convention — getSerializedValue() returns -1 for UNKNOWN, and nothing 
stops it being
     written; it's safe today only because validateTransform's upstream 
fail-fast happens to gate every write path (TransformClient.java:373 upsert, 
Transform.java:129
     delete). Fix: throw in getSerializedValue() when this == UNKNOWN, so any 
persist attempt fails loudly at the type boundary regardless of call path. This 
subsumes the
     need for separate guards on 
removeTransformRecord/completeTransform/abortTransform. Plus a test that the 
accessor throws for UNKNOWN and known types still round-trip.



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