I'm using PySpark to read data from an Oracle DB table. The way I do that is:
profiles = spark.read.jdbc(
url=db_url,
table='(select /*+ SCN_ASCENDING */ '
'data, sys_hashval from profiles)',
properties=connection_details,
predicates=predicates_list)
Spark translates this into a query of this form:
SELECT "ID","DATA"
FROM (
select /*+ FULL(profiles) SCN_ASCENDING */ id, data, sys_hashval
from profiles
)
WHERE sys_hashval >= 10840662 and sys_hashval < 11012736
Which is causing problems because the hint that is added by me to the inner sub query is not in the outer query which is added by Spark. Is there anyway to modify the outer query? Or Spark doesn't give the ability to control that?
Thanks