Spark Datasets move away from Row\'s to Encoder\'s for Pojo\'s/primitives. The Catalyst engine uses an ExpressionEncoder to convert column
Encoder
Catalyst
ExpressionEncoder
I imported spark.implicits._ Where spark is the SparkSession and it solved the error and custom encoders got imported.
Also, writing a custom encoder is a way out which I've not tried.
Working solution:- Create SparkSession and import the following
import spark.implicits._