I have a SQL query like this:
select ... from table1 where id in (slect id from table 1 where (some condition) UNION select id from table2 where (some condition)) table1
I have made a partition of 200 where upper bound is 200 and lower bound is 0 and partition will be done on partition_key column which has value ranged from 1 to 200. I am using JDBC connector. I am passing options("dbtable,table) where table is the query mentioned above.
How will the internal query in Spark look like? Since we are using UNION will it not affect the partitioning?