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 scala.collection.mutable
|
||||
|
||||
trait SparkApp {
|
||||
trait SparkApp extends Serializable {
|
||||
|
||||
/** Utility to parse the arguments.properties using the
|
||||
* property json in the classpath identified from
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.slf4j.{Logger, LoggerFactory}
|
|||
import eu.dnetlib.dhp.schema.oaf.Relation
|
||||
import eu.dnetlib.scholix.CheckRelation.logger
|
||||
|
||||
class CheckRelation( args: Array[String], log: Logger) extends AbstractScalaApplication( args: Array[String], log: Logger) {
|
||||
class CheckRelation( args: Array[String], log: Logger) extends AbstractScalaApplication( args: Array[String], log: Logger) {
|
||||
|
||||
def filterRelations(r: Relation): Boolean = {
|
||||
val relClassFilter = List(
|
||||
|
@ -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]))
|
||||
.filter(r => r.getDataInfo != null && !r.getDataInfo.getDeletedbyinference)
|
||||
.filter(r => r.getSource.startsWith("50") && r.getTarget.startsWith("50"))
|
||||
// .filter(r => filterRelations(r))
|
||||
.filter(r => filterRelations(r))
|
||||
.count()
|
||||
|
||||
logger.warn(s"Relation used by Scholexplorer $total_rels_from_scholexplorer")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue