Skip to content

Commit

Permalink
fix: allow proto to rel conversion of empty VirtualScan
Browse files Browse the repository at this point in the history
  • Loading branch information
vbarua committed Nov 2, 2023
1 parent 2d1b359 commit 01bae08
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.substrait.relation;

import static io.substrait.expression.proto.ProtoExpressionConverter.EMPTY_TYPE;

import io.substrait.expression.AggregateFunctionInvocation;
import io.substrait.expression.Expression;
import io.substrait.expression.FunctionArg;
Expand Down Expand Up @@ -108,7 +106,12 @@ public Rel from(io.substrait.proto.Rel rel) {

private Rel newRead(ReadRel rel) {
if (rel.hasVirtualTable()) {
return newVirtualTable(rel);
var virtualTable = rel.getVirtualTable();
if (virtualTable.getValuesCount() == 0) {
return newEmptyScan(rel);
} else {
return newVirtualTable(rel);
}
} else if (rel.hasNamedTable()) {
return newNamedScan(rel);
} else if (rel.hasLocalFiles()) {
Expand Down

0 comments on commit 01bae08

Please # to comment.