Problem
SqlToRddOperator currently converts JDBC query results into Spark RDDs by:
- Executing the JDBC query
- Collecting the entire
ResultSet into driver memory
- Calling
sc.parallelize(...)
Relevant code:
see SqlToRddOperator.java around lines 90–93
Why this is problematic
This implementation is not scalable for large datasets because:
- All JDBC results are materialized in the Spark driver JVM.
- The driver can become a memory bottleneck.
- Spark JDBC partitioning is not used.
- Data transfer is centralized instead of distributed.
For analytical engines such as Trino, BigQuery, presto, large query results are expected, so this execution shape can significantly limit scalability.
Suggested direction
Instead of collecting the full ResultSet into the driver, the operator could leverage Spark's JDBC reader APIs and partitioned reads where possible.
Problem
SqlToRddOperatorcurrently converts JDBC query results into Spark RDDs by:ResultSetinto driver memorysc.parallelize(...)Relevant code:
see
SqlToRddOperator.javaaround lines 90–93Why this is problematic
This implementation is not scalable for large datasets because:
For analytical engines such as Trino, BigQuery, presto, large query results are expected, so this execution shape can significantly limit scalability.
Suggested direction
Instead of collecting the full
ResultSetinto the driver, the operator could leverage Spark's JDBC reader APIs and partitioned reads where possible.