Skip to content

Commit

Permalink
fix: spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
Blizzara committed Nov 21, 2024
1 parent 591848a commit e374c85
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,20 @@ public Expression from(io.substrait.proto.Expression expr) {
var rel = protoRelConverter.from(expr.getSubquery().getScalar().getInput());
yield ImmutableExpression.ScalarSubquery.builder()
.input(rel)
.type(rel.getRecordType().accept(new TypeVisitor.TypeThrowsVisitor<Type, RuntimeException>("Expected struct field") {
@Override
public Type visit(Type.Struct type) throws RuntimeException {
if (type.fields().size() != 1) {
throw new UnsupportedOperationException("Scalar subquery must have exactly one field");
}
return type.fields().get(0);
}
}))
.type(
rel.getRecordType()
.accept(
new TypeVisitor.TypeThrowsVisitor<Type, RuntimeException>(
"Expected struct field") {
@Override
public Type visit(Type.Struct type) throws RuntimeException {
if (type.fields().size() != 1) {
throw new UnsupportedOperationException(
"Scalar subquery must have exactly one field");
}
return type.fields().get(0);
}
}))
.build();
}
case IN_PREDICATE -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ class ToSubstraitRel extends AbstractLogicalPlanVisitor with Logging {

override def visitWindow(window: Window): relation.Rel = {
val windowExpressions = window.windowExpressions
.flatMap(expr => expr.collect { case w: WindowExpression => w })
.map(fromWindowCall(_, window.child.output))
.flatMap(expr => expr.collect { case w: WindowExpression => w })
.map(fromWindowCall(_, window.child.output))
.asJava

val partitionExpressions = window.partitionSpec.map(toExpression(window.child.output)).asJava
Expand Down

0 comments on commit e374c85

Please sign in to comment.