All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.napalabs.spark.hscan.implicits.scala Maven / Gradle / Ivy

Go to download

hyperscan wrapper for spark to allow matching large numbers (up to tens of thousands) of regular expressions

The newest version!
package ru.napalabs.spark.hscan

import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.catalyst.FunctionIdentifier
import org.apache.spark.sql.catalyst.expressions.Expression
import ru.napalabs.spark.hscan.funcs.HyperscanLike

object implicits extends Serializable {

  implicit class SessionImplicits(spark: SparkSession) {
    def registerHyperscanFuncs() = {
      spark.sessionState.functionRegistry
        .registerFunction(FunctionIdentifier("hlike"),
          (expressions: Seq[Expression]) => {
            HyperscanLike(expressions(0), expressions(1))
          }
        )
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy