xiangfu0 commented on code in PR #20027:
URL: https://github.com/apache/pinot/pull/20027#discussion_r4371629662
##########
pinot-spi/src/main/java/org/apache/pinot/spi/data/FieldSpec.java:
##########
@@ -880,6 +950,12 @@ public Object convert(String value) {
return value;
case BYTES:
return BytesUtils.toBytes(value);
+ case VARIANT:
+ byte[] envelope = BytesUtils.toBytes(value);
+ if (envelope.length != 0) {
+ VariantEnvelope.decode(envelope);
Review Comment:
At the SPI layer a non-empty user-supplied `defaultNullValue` for VARIANT is
accepted here (decoded as a valid PVAR envelope), while the design restricts
VARIANT to the empty-byte null sentinel. That constraint lands in the
segment-local validation PR (3/8), so this is fine as-is — just flagging that
SPI is intentionally permissive.
##########
pinot-spi/src/main/java/org/apache/pinot/spi/data/FieldSpec.java:
##########
@@ -880,6 +950,12 @@ public Object convert(String value) {
return value;
case BYTES:
return BytesUtils.toBytes(value);
+ case VARIANT:
+ byte[] envelope = BytesUtils.toBytes(value);
+ if (envelope.length != 0) {
+ VariantEnvelope.decode(envelope);
Review Comment:
At the SPI layer a non-empty user-supplied `defaultNullValue` for VARIANT is
accepted here (decoded as a valid PVAR envelope), while the design restricts
VARIANT to the empty-byte null sentinel. That constraint lands in the
segment-local validation PR (3/8), so this is fine as-is — just flagging that
SPI is intentionally permissive.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]