all spark apps extends serializable
This commit is contained in:
parent
11634d1cc5
commit
faa1c38b29
|
@ -5,7 +5,7 @@ import org.apache.spark.sql.SparkSession
|
||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
import scala.collection.mutable
|
import scala.collection.mutable
|
||||||
|
|
||||||
trait SparkApp {
|
trait SparkApp extends Serializable {
|
||||||
|
|
||||||
/** Utility to parse the arguments.properties using the
|
/** Utility to parse the arguments.properties using the
|
||||||
* property json in the classpath identified from
|
* property json in the classpath identified from
|
||||||
|
|
|
@ -58,11 +58,13 @@ class CheckRelation( args: Array[String], log: Logger) extends AbstractScalaAppl
|
||||||
val total_rels_from_scholexplorer = df.map(s=> mapper.readValue(s, classOf[Relation]))
|
val total_rels_from_scholexplorer = df.map(s=> mapper.readValue(s, classOf[Relation]))
|
||||||
.filter(r => r.getDataInfo != null && !r.getDataInfo.getDeletedbyinference)
|
.filter(r => r.getDataInfo != null && !r.getDataInfo.getDeletedbyinference)
|
||||||
.filter(r => r.getSource.startsWith("50") && r.getTarget.startsWith("50"))
|
.filter(r => r.getSource.startsWith("50") && r.getTarget.startsWith("50"))
|
||||||
// .filter(r => filterRelations(r))
|
.filter(r => filterRelations(r))
|
||||||
.count()
|
.count()
|
||||||
|
|
||||||
logger.warn(s"Relation used by Scholexplorer $total_rels_from_scholexplorer")
|
logger.warn(s"Relation used by Scholexplorer $total_rels_from_scholexplorer")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue