@ Override public Scan open ( ) { TempTable tt = copyRecordsFrom ( rhs ) ; TableInfo ti = tt . getTableInfo ( ) ; Scan leftscan = lhs . open ( ) ; return new MultiBufferProductScan ( leftscan , ti , tx ) ; }
A scan for this query is created and returned as follows . First the method materializes its RHS query . It then determines the optimal chunk size based on the size of the materialized file and the number of available buffers . It creates a chunk plan for each chunk saving them in a list . Finally it creates a multiscan for this list of plans and returns that scan .