Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public class DefaultExtensionCatalog {
/** Identifier for extension types. */
public static final String EXTENSION_TYPES = "extension:io.substrait:extension_types";

/** Extension identifier for unsigned integer types and functions. */
public static final String UNSIGNED_INTEGERS = "extension:io.substrait:unsigned_integers";

/** Default collection of built-in extensions loaded from YAML resources. */
public static final SimpleExtension.ExtensionCollection DEFAULT_COLLECTION =
loadDefaultCollection();
Expand Down Expand Up @@ -93,6 +96,7 @@ private static SimpleExtension.ExtensionCollection loadDefaultCollection() {
.collect(Collectors.toList());

defaultFiles.add("/substrait/extensions/extension_types.yaml");
defaultFiles.add("/substrait/extensions/unsigned_integers.yaml");

return SimpleExtension.load(defaultFiles);
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/io/substrait/relation/Expand.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
@Value.Enclosing
@Value.Immutable
public abstract class Expand extends SingleInputRel {
public abstract class Expand extends SingleInputRel implements HasExtension {

/**
* Returns the fields produced by the expand operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,9 @@ protected Expand newExpand(ExpandRel rel) {
.remap(optionalRelmap(rel.getCommon()))
.hint(optionalHint(rel.getCommon()))
.relAnchor(optionalRelAnchor(rel.getCommon()));
if (rel.hasAdvancedExtension()) {
builder.extension(protoExtensionConverter.fromProto(rel.getAdvancedExtension()));
}
return builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,10 @@ public Rel visit(Expand expand, EmptyVisitationContext context) throws RuntimeEx
"Consistent or Switching fields must be set for the Expand relation.");
}
});

expand
.getExtension()
.ifPresent(ae -> builder.setAdvancedExtension(extensionProtoConverter.toProto(ae)));
return Rel.newBuilder().setExpand(builder).build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ void expand() {
Expand.builder()
.from(sb.expand(__ -> Collections.emptyList(), commonTable))
.commonExtension(commonExtension)
.extension(relExtension)
.build();
verifyRoundTrip(rel);
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spark-3-5 = "3.5.4"
spark-4-0 = "4.0.2"
spotless = "8.9.0"
# substrait-packaging artifacts, versioned by the Substrait spec release they are generated from.
substrait-packaging = "0.99.0"
substrait-packaging = "0.100.0"
testcontainers = "2.0.5"
validator = "3.0.6"

Expand Down
Loading