Skip to content

Commit f9b29d4

Browse files
committed
[SLT] Add missing casts in output values
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
1 parent 36ae672 commit f9b29d4

File tree

1 file changed

+6
-2
lines changed
  • sql-to-dbsp-compiler/slt/src/main/java/org/dbsp/sqllogictest/executors

1 file changed

+6
-2
lines changed

sql-to-dbsp-compiler/slt/src/main/java/org/dbsp/sqllogictest/executors/DBSPExecutor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.dbsp.sqlCompiler.compiler.frontend.TableContents;
4040
import org.dbsp.sqlCompiler.compiler.frontend.calciteCompiler.ProgramIdentifier;
4141
import org.dbsp.sqlCompiler.compiler.frontend.calciteObject.CalciteObject;
42+
import org.dbsp.sqlCompiler.compiler.visitors.inner.CreateRuntimeErrorWrappers;
4243
import org.dbsp.sqlCompiler.ir.DBSPFunction;
4344
import org.dbsp.sqlCompiler.ir.DBSPNode;
4445
import org.dbsp.sqlCompiler.ir.expression.DBSPApplyExpression;
@@ -216,7 +217,8 @@ boolean runBatch(TestStatistics result, boolean cleanup) {
216217
}
217218

218219
/** Convert a description of the data in the SLT format to a ZSet. */
219-
public static DBSPZSetExpression convert(@Nullable List<String> data, DBSPTypeZSet outputType) {
220+
public static DBSPZSetExpression convert(
221+
DBSPCompiler compiler, @Nullable List<String> data, DBSPTypeZSet outputType) {
220222
if (data == null)
221223
data = Linq.list();
222224
DBSPZSetExpression result;
@@ -272,6 +274,8 @@ else if (colType.is(DBSPTypeBool.class))
272274
throw new RuntimeException("Could not assign all query output values to rows. " +
273275
"I have " + col + " leftover values in the last row");
274276
}
277+
CreateRuntimeErrorWrappers cw = new CreateRuntimeErrorWrappers(compiler);
278+
result = cw.apply(result).to(DBSPZSetExpression.class);
275279
return result;
276280
}
277281

@@ -311,7 +315,7 @@ ProgramAndTester generateTestCase(
311315
DBSPTypeZSet outputType = sink.outputType.to(DBSPTypeZSet.class);
312316
DBSPZSetExpression expectedOutput = null;
313317
if (testQuery.outputDescription.hash == null) {
314-
expectedOutput = DBSPExecutor.convert(testQuery.outputDescription.getQueryResults(), outputType);
318+
expectedOutput = DBSPExecutor.convert(compiler, testQuery.outputDescription.getQueryResults(), outputType);
315319
}
316320

317321
return createTesterCode(

0 commit comments

Comments
 (0)