Skip to content

Commit

Permalink
UAST: register udf for sql queries
Browse files Browse the repository at this point in the history
  • Loading branch information
bzz committed Sep 19, 2017
1 parent 6ff11c5 commit f31b1e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/scala/tech/sourced/api/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ object Implicits {
Implicits.checkCols(df, "path", "content")
import org.apache.spark.sql.functions.udf
val extractUastUDF = udf(BblfshUDF.extractUAST)
df.sparkSession.udf.register("extract_uasts", extractUastUDF)
df.withColumn("uast", extractUastUDF('path, 'content))
}

Expand Down

0 comments on commit f31b1e5

Please sign in to comment.