I have a table that is a df which also has a view created with
table.createOrReplaceTempView("table")
and the query is
spark.sql("SELECT column1 from TABLE where column2 = 'VALUE'")
i want to rewrite the query as
TABLE.filter(TABLE("column2") === "value").select(col("column1"))
so which query is much faster the normal spark.sql or with filter and select ? when using large datasets.