
ru.napalabs.spark.hscan.functions.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spark-hscan_2.11 Show documentation
Show all versions of spark-hscan_2.11 Show documentation
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.Column
import org.apache.spark.sql.catalyst.expressions.{Expression, Literal}
import ru.napalabs.spark.hscan.funcs.HyperscanLike
object functions {
private def withExpr(expr: Expression): Column = new Column(expr)
/**
* Hyperscan regex like. Hyperscan regexps differs from java regexps,
* see hyperscan documentation
* @return boolean column with match result
*/
def hlike(e: Column, patterns: Array[String]): Column = withExpr{
HyperscanLike(e.expr, Literal(patterns))
}
/**
* Hyperscan regex like. Hyperscan regexps differs from java regexps,
* see hyperscan documentation
* @return boolean column with match result
*/
def hlike(e: Column, patterns: Column): Column = withExpr{
HyperscanLike(e.expr, patterns.expr)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy