'Scala 2.13 overloaded foreachBatch

I am trying to write stream dataset to snowflake as indicated below

val query = expandedDF.writeStream
    .trigger(Trigger.ProcessingTime("30 seconds"))
    .foreachBatch{(batchDF:DataFrame, batchID: Long) => 
    batchDF.write
        .format(SNOWFLAKE_SOURCE_NAME)
        .options(sfOptions) 
        .option("dbtable", "TWITTER")
        .mode(SaveMode.Append)
        .save()

    }
    .outputMode("update")
    .start()

query.awaitTermination()

However, whenever this command is executed I run into the error

overloaded method foreachBatch with alternatives

anyone here knows how I can resolve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source