-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove unused code (#141) * Revert "Setting version to 0.3.4-SNAPSHOT" This reverts commit 2f1d7be. * README: update to 0.3.3 * README: fix javadoc badge * remove unused param * [sbt] version updates * [conf] allow not_analyzed string fields (#145) * [not-analyzed-fields] do not analyzed fields ending with _notanalyzed * [hotfix] fixes issue 150 * [tests] issue 150 * fix typo * [blockEntityLinkage] drop queryPartColumns
- Loading branch information
Showing
3 changed files
with
25 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,12 +37,21 @@ class BlockingLinkageSpec extends FlatSpec | |
val spark = SparkSession.builder().getOrCreate() | ||
import spark.implicits._ | ||
|
||
val people: Array[Person] = Array("fear", "death", "water", "fire", "house") | ||
val peopleLeft: Array[Person] = Array("fear", "death", "water", "fire", "house") | ||
.zipWithIndex.map { case (str, index) => | ||
val email = if (index % 2 == 0) "[email protected]" else "[email protected]" | ||
Person(str, index, email) | ||
} | ||
val df = sc.parallelize(people).repartition(2).toDF() | ||
|
||
val peopleRight: Array[Person] = Array("fear", "death", "water", "fire", "house") | ||
.zipWithIndex.map { case (str, index) => | ||
val email = if (index % 2 == 0) "[email protected]" else "[email protected]" | ||
Person(str, index, email) | ||
} | ||
|
||
val leftDF = sc.parallelize(peopleLeft).repartition(2).toDF() | ||
val rightDF = sc.parallelize(peopleRight).repartition(3).toDF() | ||
|
||
|
||
val linker: Row => String = { row => | ||
val name = row.getString(row.fieldIndex("name")) | ||
|
@@ -51,10 +60,10 @@ class BlockingLinkageSpec extends FlatSpec | |
} | ||
|
||
|
||
val linked = LuceneRDD.blockEntityLinkage(df, df, linker, | ||
val linked = LuceneRDD.blockEntityLinkage(leftDF, rightDF, linker, | ||
Array("email"), Array("email")) | ||
|
||
val linkedCount, dfCount = (linked.count, df.count()) | ||
val linkedCount, dfCount = (linked.count, leftDF.count()) | ||
|
||
linkedCount should equal(dfCount) | ||
|
||
|