I have to user spark. But ranger policies are not getting applied on spark.
There isn't Spark + Ranger support as of now.
If you want to apply ranger policies you'd need to use Spark LLAP.
Hope this helps.