Skip to content

Conversation

@lewiszlw
Copy link
Member

@lewiszlw lewiszlw commented Jan 9, 2026

Summary

This PR refactors the scan and insert execution plans to eliminate block_in_place calls during codec decode.

Changes

  • RemoteTableScanExec and RemoteTableInsertExec: Changed from holding Arc<dyn Connection> to Option<Arc<dyn Pool>>
  • Lazy pool creation: When pool is None (e.g., after deserialization), the pool is created lazily during execute()
  • Removed ConnectionCodec: The ConnectionCodec trait and DefaultConnectionCodec implementation are no longer needed
  • Simplified RemotePhysicalCodec: Removed connection_codec field

Benefits

  • Eliminates block_in_place during codec decode, improving async compatibility
  • Simplifies the codec infrastructure
  • Pool creation happens in async context where it belongs

…nsert plans

- Change RemoteTableScanExec and RemoteTableInsertExec to hold Option<Arc<dyn Pool>> instead of Arc<dyn Connection>
- Create pool lazily during execute() when pool is None
- Remove ConnectionCodec trait and DefaultConnectionCodec
- Remove connection_codec field from RemotePhysicalCodec
- This eliminates block_in_place during codec decode, improving async compatibility
…ching

- Remove 'connection' field from RemoteTableScanExec and RemoteTableInsertExec proto messages
- Change pool field type from Option<Arc<dyn Pool>> to Arc<Mutex<Option<Arc<dyn Pool>>>>
- Pool is created lazily on first use and cached in the Mutex for subsequent reuse
- Add get_or_create_pool helper function for thread-safe lazy initialization
@lewiszlw lewiszlw merged commit 2b56941 into master Jan 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants