@ Override public Scan open ( ) { SortScan ss1 = ( SortScan ) sp1 . open ( ) ; SortScan ss2 = ( SortScan ) sp2 . open ( ) ; return new MergeJoinScan ( ss1 , ss2 , fldName1 , fldName2 ) ; }
The method first sorts its two underlying scans on their join field . It then returns a mergejoin scan of the two sorted table scans .