Skip to content

Commit 83f239e

Browse files
committed
cleanup
1 parent 0bfd2e1 commit 83f239e

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

src/main/scala/edu/berkeley/cs/rise/opaque/execution/operators.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ case class EncryptedSortMergeJoinExec(
289289
case Inner =>
290290
(leftSchema ++ rightSchema).map(_.toAttribute)
291291
case LeftOuter =>
292-
leftSchema++ rightSchema.map(_.withNullability(true))
292+
leftSchema ++ rightSchema.map(_.withNullability(true))
293293
case LeftSemi | LeftAnti =>
294294
leftSchema.map(_.toAttribute)
295295
case _ =>

src/main/scala/edu/berkeley/cs/rise/opaque/strategies.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,9 @@ object OpaqueOperators extends Strategy {
100100
rightProjSchema.map(_.toAttribute),
101101
sorted)
102102

103-
104103
val tagsDropped = joinType match {
105-
case LeftOuter | Inner => EncryptedProjectExec(dropTags(left.output, right.output), joined)
106-
case LeftSemi | LeftAnti => EncryptedProjectExec(left.output, joined)
104+
case Inner | LeftOuter => EncryptedProjectExec(dropTags(left.output, right.output), joined)
105+
case LeftExistence(_) => EncryptedProjectExec(left.output, joined)
107106
}
108107

109108
val filtered = condition match {

src/test/scala/edu/berkeley/cs/rise/opaque/OpaqueOperatorTests.scala

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,36 @@ trait OpaqueOperatorTests extends OpaqueTestsBase { self =>
452452
df.collect
453453
}
454454

455+
testAgainstSpark("join on floats") { securityLevel =>
456+
val p_data = for (i <- 0 to 16) yield (i, i.toFloat, i * 10)
457+
val f_data = (0 until 256).map(x => {
458+
if (x % 3 == 0)
459+
(x, null.asInstanceOf[Float], x * 10)
460+
else
461+
(x, (x % 16).asInstanceOf[Float], x * 10)
462+
}).toSeq
463+
464+
val p = makeDF(p_data, securityLevel, "id", "pk", "x")
465+
val f = makeDF(f_data, securityLevel, "id", "fk", "x")
466+
val df = p.join(f, $"pk" === $"fk")
467+
df.collect.toSet
468+
}
469+
470+
testAgainstSpark("join on doubles") { securityLevel =>
471+
val p_data = for (i <- 0 to 16) yield (i, i.toDouble, i * 10)
472+
val f_data = (0 until 256).map(x => {
473+
if (x % 3 == 0)
474+
(x, null.asInstanceOf[Double], x * 10)
475+
else
476+
(x, (x % 16).asInstanceOf[Double], x * 10)
477+
}).toSeq
478+
479+
val p = makeDF(p_data, securityLevel, "id", "pk", "x")
480+
val f = makeDF(f_data, securityLevel, "id", "fk", "x")
481+
val df = p.join(f, $"pk" === $"fk")
482+
df.collect.toSet
483+
}
484+
455485
def abc(i: Int): String = (i % 3) match {
456486
case 0 => "A"
457487
case 1 => "B"

0 commit comments

Comments
 (0)