Add following Library to class path and set "avro.mapred.ignore.inputs.without.extension" to false - spark-shell --packages com.databricks:spark-avro_2.11:4.0.0 --conf "spark.hadoop. avro.mapred.ignore.inputs.without.extension=false "
Say, we have table_1 like - unit | req_type A | 1 A | 2 B | 2 B | 3 D | 2 E | 2 E | 4 We have to write a SQL such that, we can select Unit with Req_Type=2 Also, that Unit should not have any other Req_Type in list. Ex - 1,3 Solution - We can add another column such that - case when req_type in (1,3) then 1 else 0 end col1 unit | req_type | col1 A | 1 | 1 A | 2 | 0 B | 2 | 0 B | 3 | 1 D ...