Last active
April 14, 2020 15:20
-
-
Save ottomata/af8227c4b55a4ba270254e41d65f36b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// spark2-shell --driver-java-options='-Drefinery.log.level=DEBUG' --jars /srv/deployment/analytics/refinery/artifacts/refinery-hive.jar | |
sc.setLogLevel("DEBUG") | |
spark.sql("CREATE TEMPORARY FUNCTION geocode_data as 'org.wikimedia.analytics.refinery.hive.GetGeoDataUDF'") | |
case class Ip(ip: String) {} | |
val data = Seq(Ip("81.2.69.160"), Ip("81.2.69.160"), Ip("81.2.69.160"), Ip("81.2.69.160")) | |
val df = spark.createDataFrame(data).repartition(2) | |
df.selectExpr("geocode_data(ip)").show | |
// java.lang.NullPointerException | |
// at org.wikimedia.analytics.refinery.hive.GetGeoDataUDF.evaluate(GetGeoDataUDF.java:153) | |
// at org.apache.spark.sql.hive.HiveGenericUDF.eval(hiveUDFs.scala:177) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment