I just ran across an unexpected behaviour in Intelli J IDEAs (v.2016.2
) "Evaluate Expression" window:
While this works, both as compiled code and using the "Evaluate Expression" window
val df1 = spark.read.json("/examples/src/main/resources/people.json")
df1.columns.foreach(println) // outputs "age" and "name" to console
Another Dataset[Row]
(DataFrame
) that involves some Columns
generated by expressions only works as compiled code, while in the "Evaluate Expression" window the following exception is displayed:
com.intellij.debugger.engine.evaluation.EvaluateException:
Type mismatch Can't assign org.apache.spark.sql.Dataset to scala.runtime.ObjectRef
Both dataframes are of class class org.apache.spark.sql.Dataset
. According to Intelli Js documentation the only limitations are:
- A method can be invoked within the Expression Evaluation dialog only if the debugger has stopped at a breakpoint, but has not been paused.
- Expression Evaluation can only be "single-level". In other words, if IntelliJ IDEA stops at a breakpoint within a method called from the Expression Evaluation, you cannot use the Expression Evaluation feature again.
- If a method invoked within Expression Evaluation has a breakpoint inside its body, this breakpoint will be ignored.
That is apparently only half the truth.