Skip to content

Commit

Permalink
issue-32: adding new signature (cerner#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrillard authored and rbrush committed Jul 17, 2018
1 parent f808237 commit 2d30289
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion bunsen-core/src/main/java/com/cerner/bunsen/ValueSetUdfs.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ public static synchronized void pushUdf(SparkSession spark, BroadcastableValueSe

Broadcast<BroadcastableValueSets> broadcast = ctx.broadcast(valueSets);

pushUdf(spark, broadcast);
}

/**
* Pushes an "in_valueset" UDF that uses an already broadcast instance of
* {@link BroadcastableValueSets} for its content.
*
* @param spark the spark session
* @param broadcast the broadcast valuesets to use in the UDF
*/
public static synchronized void pushUdf(SparkSession spark,
Broadcast<BroadcastableValueSets> broadcast) {

spark.udf()
.register("in_valueset",
new InValuesetUdf(broadcast),
Expand All @@ -103,7 +116,6 @@ public static synchronized void pushUdf(SparkSession spark, BroadcastableValueSe
valueSetStack.push(broadcast);
}


/**
* Pops a BroadcastableValueSets from the user-defined function stack.
*
Expand Down

0 comments on commit 2d30289

Please sign in to comment.