Update the file to hdfs directory first.
import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
import org.apache.spark.sql.Encoder
// For implicit conversions from RDDs to DataFrames
import spark.implicits._
case class Call(day:String, time: String, src: String)
val callDF = sc.textFile("iptables/calltable.txt").map(_.split(" ")).map(attributes => Call(attributes(0).trim, attributes(1).trim, attributes(2).trim)).toDF()
// Register the DataFrame as a temporary view
callDF.createOrReplaceTempView("call")