Works. Thanks Hosur. On Thu, Mar 30, 2017 at 8:37 PM, hosur narahari <hnr1...@gmail.com> wrote:
> 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 > > >