I have imported
import org.apache.spark.sql.Column;
import org.apache.spark.sql.functions;
in my Java-Spark driver
But
DataFrame inputDFTwo = hiveContext.sql("select * from sourcing_src_tbl");
inputDFTwo.withColumn("asofdate", lit("2016-10-2"));
here "lit" is still showing error in eclipse(windows).Which library should I include to make it work.
Either import object like you do know and use it to access method:
import org.apache.spark.sql.functions;
df.withColumn("foo", functions.lit(1));
or use import static
and call method directly:
import static org.apache.spark.sql.functions.lit;
df.withColumn("foo", lit(1));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With