Guest User

Untitled

a guest
Oct 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. test("SparkTest 0280") {
  2. val conf = new SparkConf().set("spark.sql.codegen.wholeStage", "false").set("spark.sql.cbo.enabled", "true")
  3. val spark = SparkSession.builder().config(conf).master("local").appName("SparkTest").enableHiveSupport().getOrCreate()
  4.  
  5. import spark.implicits._
  6.  
  7.  
  8. Seq[(Int,Int)]((null, 1), (2, null), (null, 3)).toDF("a", "b").createOrReplaceTempView("t")
  9. spark.sql("select a,b,nvl(a,b) from t").show(truncate = false)
  10.  
  11. Error:(565, 21) an expression of type Null is ineligible for implicit conversion
  12. Seq[(Int,Int)]((null, 1), (2, null), (null, 3)).toDF("a", "b").createOrReplaceTempView("t")
Add Comment
Please, Sign In to add comment