feat(core): add MaskExpression POJO and ReadRel projection support#782
Draft
flex-seongmin wants to merge 3 commits intosubstrait-io:mainfrom
Draft
feat(core): add MaskExpression POJO and ReadRel projection support#782flex-seongmin wants to merge 3 commits intosubstrait-io:mainfrom
flex-seongmin wants to merge 3 commits intosubstrait-io:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement the
MaskExpressionPOJO layer forReadRelprojection support in substrait-java.The Substrait protobuf spec defines
Expression.MaskExpressionas a field onReadRel(field 4:projection), but the Java POJO layer had only a TODO comment and no actual implementation. This means anyReadRelprojection information was silently dropped during proto-to-POJO conversion, and POJO-constructed plans could not express column projection at the read level.This change closes that gap by introducing a full POJO model for
MaskExpressionand wiring it through the existing conversion infrastructure.Changes
MaskExpression.java(new) --@Value.Enclosinginterface with 11@Value.Immutableinner types (MaskExpr,Select,StructSelect,StructItem,ListSelect,ListSelectItem,ListElement,ListSlice,MapSelect,MapKey,MapKeyExpression) matching the proto definition 1:1MaskExpressionProtoConverter.java(new) -- Dedicated bidirectional converter betweenio.substrait.proto.Expression.MaskExpressionand the POJO types, keeping proto FQN references isolated from the relation convertersAbstractReadRel.java-- Replaced TODO comment withOptional<MaskExpression.MaskExpr> getProjection()ProtoRelConverter.java-- AddedoptionalMaskExpression()helper; all fourReadRelsubtypes (NamedScan,LocalFiles,VirtualTableScan,ExtensionTable) now populate projection during proto-to-POJO conversionRelProtoConverter.java-- All fourvisit(ReadRel)methods now serialize projection back to proto viaMaskExpressionProtoConverter.toProto()Testing
Added 11 roundtrip tests in
ReadRelRoundtripTestcovering:StructSelectonly)StructItemwith childSelect.ofStruct)ListSelect)ListSelect+ childStructSelect)MapSelectwithMapKey)MapKeyExpression)MapSelect+ childStructSelect)maintainSingularStructflagVirtualTableScanandLocalFiles