Skip to content

Commit

Permalink
Bump hiveless version up
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Apr 9, 2022
1 parent d8e5dbe commit 70e8af3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val shapelessVersion = "2.3.3" // to be compatible with Spark 3.1.x
val scalaTestVersion = "3.2.11"
val jtsVersion = "1.18.1"
val geomesaVersion = "3.3.0"
val hivelessVersion = "0.0.3"
val hivelessVersion = "0.0.4"
val geotrellisVersion = "3.6.2"

// GeoTrellis depends on Shapeless 2.3.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ import scala.util.Properties
trait HiveTestEnvironment extends TestEnvironment { self: Suite with BeforeAndAfterAll =>
import HiveTestEnvironment._

// function to override Hive SQL functions registration
def registerHiveUDFs(ssc: SparkSession): Unit =
def loadSQL(path: String): List[String] =
Source
.fromFile(new File("../core/sql/createUDFs.sql").toURI)
.fromFile(new File(path).toURI)
.using(_.mkString.split(";").toList.map(_.trim).filter(_.nonEmpty))
.foreach(ssc.sql)

def spatialFunctions: List[String] = loadSQL("../core/sql/createUDFs.sql")

// function to override Hive SQL functions registration
def registerHiveUDFs(ssc: SparkSession): Unit =
spatialFunctions.foreach(ssc.sql)

// function to override optimizations
def registerOptimizations(sqlContext: SQLContext): Unit =
Expand Down

0 comments on commit 70e8af3

Please sign in to comment.