Substrait Modifications in Gluten
Substrait is a project aiming to create a well-defined, cross-language specification for data compute operations. Since it is still under active development, there are some lacking representations for Gluten needed computing operations. At the same time, some existing representations need to be modified a bit to satisfy the needs of computing.
In Gluten, the base version of Substrait is v0.23.0, with some messages since rebased onto later upstream versions (noted per entry below). This page records all the Gluten changes to Substrait proto files for reference. It is preferred to upstream these changes to Substrait, but for those cannot be upstreamed, alternatives like AdvancedExtension could be considered.
Numbering convention for local additions. Gluten-local fields are numbered from 1000 up, outside the range upstream allocates, so that a future upstream field addition cannot collide with them. This convention exists because the older practice of grafting local fields onto the next free low number caused collisions: Gluten’s bucket_spec was originally grafted at WriteRel field 7, which upstream v0.98.0 later assigned to common.
Modifications to algebra.proto
- Added
JsonReadOptionsandTextReadOptionsinFileOrFiles(#1584). - Changed join type
JOIN_TYPE_SEMItoJOIN_TYPE_LEFT_SEMIandJOIN_TYPE_RIGHT_SEMI(#408). - Added
WindowRel, addedcolumn_nameandwindow_typeinWindowFunction, changedUnboundedinWindowFunctionintoUnbounded_PrecedingandUnbounded_Following, and added WindowType(#485). - Added
output_schemain RelRoot(#1901). - Added
ExpandRel(#1361). - Added
GenerateRel(#574). - Added
PartitionColumninLocalFiles(#2405). - Added
WriteRel(#3690). - Added
TopNRel(#5409). - Added
reffield in window boundPrecedingandFollowing(#5626). - Added
BucketSpecfield inWriteRel(#8386) - Added
StreamKafkainReadRel(#8321) - Rebased the
WriteRelbody onto upstreamv0.98.0: field 7 is nowcommon, withcreate_mode(8) andadvanced_extension(9) added, and theOutputModevalueOUTPUT_MODE_MODIFIED_TUPLESrenamed toOUTPUT_MODE_MODIFIED_RECORDS. Gluten’sBucketSpecfield moved off field 7 to 1000. The enclosingRel.writeoneof tag is left at 18 for now; reconciling the wholeReloneof to upstream’s numbers is a separate change. Note that Gluten attaches its writer configuration tonamed_table.advanced_extension, not to the new top-levelWriteRel.advanced_extension, which no Gluten code reads.WriteRel.commonuses Gluten’s pre-0.98RelCommoncopy (missingrel_anchor,Hint.alias,Hint.output_namesand the saved/loaded computation messages), so it cannot carry a full 0.98commonpayload.