@@ -322,7 +322,7 @@ function export(self, outfilePrefix, mbytesPerChunk)
322322 tuplesPerChunk = 1 ;
323323
324324 % enclose in transaction to ensure that LIMIT and OFFSET work correctly
325- self .schema . conn .startTransaction
325+ self .conn .startTransaction
326326
327327 savedTuples = 0 ;
328328 savedMegaBytes = 0 ;
@@ -346,7 +346,7 @@ function export(self, outfilePrefix, mbytesPerChunk)
346346 fileNumber = fileNumber + 1 ;
347347 end
348348
349- self .schema . conn .cancelTransaction
349+ self .conn .cancelTransaction
350350
351351 function mbytes = sizeMB(variable ) % #ok<INUSD>
352352 mbytes = whos(' variable' );
@@ -543,18 +543,31 @@ function restrict(self, varargin)
543543 ' dj.GeneralRelvar/mtimes requires another relvar as operand' ))
544544 end
545545 ret = init(dj .GeneralRelvar , ' join' , {self arg });
546- end
546+ end
547547
548+ function ret = pair(self , varargin )
549+ % dj.GeneralRelvar/pair - a natural join with itself with some
550+ % attributes renamed.
551+ % This facilitates a common use case when pairs of tuples from the
552+ % relation need to be examined.
553+
554+ renamedAttrs1 = cellfun(@(s ) sprintf(' %s ->%s 1' ,s ,s ), varargin ,' uni' ,false );
555+ renamedAttrs2 = cellfun(@(s ) sprintf(' %s ->%s 2' ,s ,s ), varargin ,' uni' ,false );
556+ ret = self .pro(renamedAttrs1{: })*self .pro(renamedAttrs2{: });
557+ end
548558
549559
550560 % %%%% DEPRECATED RELATIIONAL OPERATORS (for backward compatibility)
551561 function ret = times(self , arg )
562+ warning ' The relational operator .* (semijoin) will be removed in a future release. Please use & instead.'
552563 ret = self & arg ;
553564 end
554565 function ret = rdivide(self , arg )
566+ warning ' The relational operator / (antijoin) will be removed in a future release. Please use - instead.'
555567 ret = self - arg ;
556568 end
557569 function ret = plus(self , arg )
570+ warning ' The relational operator + (union) will be removed in a future release. Please use | instead'
558571 ret = self | arg ;
559572 end
560573
0 commit comments