DanielCarter-stack commented on issue #10406:
URL: https://github.com/apache/seatunnel/issues/10406#issuecomment-3809064414

   <!-- code-pr-reviewer -->
   Thanks for your interest in contributing! This feature request is valid. 
Currently, `COPY` is only supported on the **Sink** side 
(`JdbcSinkOptions.use_copy_statement`, `CopyManagerProxy.copyInMethod`), while 
the **Source** side exclusively uses standard SELECT queries 
(`ChunkSplitter.java`, `JdbcInputFormat.java`).
   
   The PostgreSQL dialect already optimizes with cursor mode 
(`PostgresDialect.creatPreparedStatement`), but `COPY ... TO STDOUT` would 
provide better performance for large exports.
   
   **Key implementation points to consider:**
   - Extend `CopyManagerProxy` to support `copyOut` (returns `InputStream`)
   - Add a new Source option (e.g., `use_copy_statement` for Source)
   - Handle `COPY` limitations: no support for custom `query` (only 
`table_path`), complex WHERE clauses, or interactions with `partition_column`
   
   **Questions to clarify:**
   1. Should `COPY` fall back to SELECT when custom `query` is configured?
   2. Should `COPY` be compatible with parallel reads via `partition_column`, 
or mutually exclusive?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to