You have import functions

dataset.withColumn(columnName,functions.lit("constant"))

Thank you
Anil Langote

Sent from my iPhone
_____________________________
From: 崔苗 <[email protected]>
Sent: Friday, March 23, 2018 8:33 AM
Subject: how to use lit() in spark-java
To: <[email protected]>


Hi Guys,

I want to add a constant column to dataset by lit function in java, like that:
 dataset.withColumn(columnName,lit("constant"))
but it's seems that idea coundn't found the lit() function,so how to use lit() 
function in java?

thanks for any reply




Reply via email to