Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class AnnoyIndexBuildSink(queryName: String, conf: TaskConf) extends Sink(queryN
override def write(inputDF: DataFrame): Unit = {
val df = repartition(preprocess(inputDF), inputDF.sparkSession.sparkContext.defaultParallelism)

if (inputDF.isStreaming) throw new IllegalStateException("AnnoyIndexBuildSink can not be run as streaming.")
if (df.isStreaming) throw new IllegalStateException("AnnoyIndexBuildSink can not be run as streaming.")
else {
ALSModelProcess.buildAnnoyIndex(conf, inputDF)
ALSModelProcess.buildAnnoyIndex(conf, df)
}
}
}