Try lit(fromDate) and lit(toDate). You've to import org.apache.spark.sql.functions.lit to use it
On 31 Mar 2017 7:45 a.m., "shyla deshpande" <deshpandesh...@gmail.com> wrote: The following works df.filter($"createdate".between("2017-03-20", "2017-03-22")) I would like to pass variables fromdate and todate to the filter instead of constants. Unable to get the syntax right. Please help. Thanks