-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support converting VirtualTableScans into LocalRelations
also fix LocalRelation -> VirtualTableScan for rows containing null values
- Loading branch information
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
spark/src/test/scala/io/substrait/spark/RelationsSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.substrait.spark | ||
|
||
import org.apache.spark.SparkFunSuite | ||
import org.apache.spark.sql.test.SharedSparkSession | ||
|
||
class RelationsSuite extends SparkFunSuite with SharedSparkSession with SubstraitPlanTestBase { | ||
|
||
override def beforeAll(): Unit = { | ||
super.beforeAll() | ||
sparkContext.setLogLevel("WARN") | ||
} | ||
|
||
test("local_relation_simple") { | ||
assertSqlSubstraitRelRoundTrip( | ||
"select * from (values (1, 'a'), (2, 'b') as table(col1, col2))" | ||
) | ||
} | ||
|
||
test("local_relation_null") { | ||
assertSqlSubstraitRelRoundTrip( | ||
"select * from (values (1), (NULL) as table(col))" | ||
) | ||
} | ||
|
||
} |