Skip to content

Commit

Permalink
Fixes unpivot
Browse files Browse the repository at this point in the history
  • Loading branch information
johnedquinn committed Feb 27, 2024
1 parent 9b309ff commit 49e718c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ internal class RelDistinct(
}

override fun close() {
seen.clear()
input.close()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ internal sealed class RelUnpivot : Operator.Relation {
* Initialize the _iterator from the concrete implementation's struct()
*/
override fun open(env: Environment) {
this.env = env
_iterator = struct().entries.iterator()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,37 +70,6 @@ class PartiQLEngineDefaultTest {
@Execution(ExecutionMode.CONCURRENT)
fun globalsTests(tc: SuccessTestCase) = tc.assert()

@Test
fun singleTest() {
val tc = SuccessTestCase(
input = """
SELECT VALUE element
FROM << { 'a': [0, 1, 2] }, { 'a': [3, 4, 5] } >> AS t, t.a AS element
""".trimIndent(),
expected = bagValue(
int32Value(0),
int32Value(1),
int32Value(2),
int32Value(3),
int32Value(4),
int32Value(5),
)
)
val tc1 = SuccessTestCase(
input = """
SELECT VALUE (
SELECT VALUE t1 + t2
FROM <<5, 6>> AS t2
) FROM <<0, 10>> AS t1;
""".trimIndent(),
expected = bagValue(
bagValue(int32Value(5), int32Value(6)),
bagValue(int32Value(15), int32Value(16))
)
)
tc1.assert()
}

companion object {

@JvmStatic
Expand Down

0 comments on commit 49e718c

Please sign in to comment.