I'm running below spark SQL query in Intellij Maven IDE,
SELECT seq_no,
amount,
(select max(b.amount)
from premium b
where b.seq_no < a.seq_no) last_high_prem
FROM premium a
Got the below error,
Exception in thread "main" org.apache.spark.sql.AnalysisException: The correlated scalar subquery can only contain equality predicates: (seq_no#11#32 < seq_no#11);
I understand correlated query when uses equality operator then only works currently in spark SQL. Is there any method to overcome this issue.
I know we can do it hiveql. But need to setup hadoop and hive in my local machine. Please let me know how to mitigate the issue.