Skip to content

Commit c48bcce

Browse files
committed
test: simplify assertSqlSubstraitRelRoundTrip
1 parent e878e86 commit c48bcce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

isthmus/src/test/java/io/substrait/isthmus/PlanTestBase.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,14 @@ protected RelRoot assertSqlSubstraitRelRoundTrip(
128128
// Assert (sql -> calcite -> substrait) and (sql -> substrait -> calcite -> substrait) are same.
129129
// Return list of sql -> Substrait rel -> Calcite rel.
130130

131+
SqlToSubstrait s2s = new SqlToSubstrait();
131132
SubstraitToCalcite substraitToCalcite = new SubstraitToCalcite(extensions, typeFactory);
132133

133-
// 1. SQL -> Calcite RelRoot
134-
RelRoot relRoot1 = SubstraitSqlToCalcite.convertQuery(query, catalogReader);
134+
// 1. SQL -> Substrait Plan
135+
Plan plan1 = s2s.convert(query, catalogReader);
135136

136-
// 2. Calcite RelRoot -> Substrait Rel
137-
Plan.Root pojo1 = SubstraitRelVisitor.convert(relRoot1, extensions);
137+
// 2. Substrait Plan -> Substrait Rel
138+
Plan.Root pojo1 = plan1.getRoots().get(0);
138139

139140
// 3. Substrait Rel -> Calcite RelNode
140141
RelRoot relRoot2 = substraitToCalcite.convert(pojo1);

0 commit comments

Comments
 (0)