⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 algebra.mal

📁 一个内存数据库的源代码这是服务器端还有客户端
💻 MAL
📖 第 1 页 / 共 3 页
字号:
#line 50 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"module algebra;command exist(b:bat[:any_1,:any_2], h:any_1):bit address ALGexistcomment "Returns whether 'h' occurs as a head value in b.";command exist(b:bat[:any_1,:any_2], h:any_1, t:any_2):bit address ALGexistBUNcomment "Returns true when 'h,t' occurs as a bun in b.";command find(b:bat[:any_1,:any_2], h:any_1):any_2 address ALGfindcomment "Returns the tail value 't' for which some [h,t] BUN 	exists in b.  If no such BUN exists, an error occurs." ;command position(b:bat[:any_1,:any_2], v:any_1):intaddress ALGpositioncomment "Returns BAT position [0.. b.count] of 'v' in the head 	column of b. It Return an error if 'v' does not exist.";command position(b:bat[:any_1,:any_2], val:any_1, tval:any_2) :int address ALGpositionBUNcomment "Returns the position of the value pair It returns an 	error if 'val' does not exist.";command fetch(b:bat[:any_2,:any_1], x:oid) :any_1 address ALGfetchoid;command fetch(b:bat[:any_2,:any_1], x:lng) :any_1 address ALGfetch;command fetch(b:bat[:any_2,:any_1], x:int) :any_1 address ALGfetchintcomment "Returns the tail value of the BUN at x-th position 	with 0 <= x < b.count";#line 89 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command fetch(b:bat[:any_1,:any_2], s:bat[:int,:any_3]) :bat[:any_1,:any_2] address ALGfetchbat;command fetch(b:bat[:any_1,:any_2], s:bat[:lng,:any_3] ) :bat[:any_1,:any_2] address ALGfetchbat;command fetch(b:bat[:any_1,:any_2], s:bat[:oid,:any_3]) :bat[:any_1,:any_2] address ALGfetchbatcomment "Returns a positional selection of b by the oid 	head values of s";#line 101 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command select(b:bat[:any_1,:any_2], low:any_2, high:any_2) 		:bat[:any_1,:any_2] address ALGselectcomment "Select all BUNs that have tail values: {v| low <= v <= high}.	NIL boundary values have a special meaning.		+ low  == nil means: no lower bound		+ high == nil means: no upper bound.		NOTE 1: you should cast the nil to the appropriate type, 				e.g. int(nil) in order to cirumvent type clashes.		NOTE 2: as the 'nil' element has no clear place in the 				ordered domain of values, tuples with 'nil' values 				are NEVER returned by the range select.";command select(b:bat[:any_1,:any_2], low:any_2, 	high:any_2, li:bit, hi:bit) :bat[:any_1,:any_2] address ALGselectInclusivecomment "Select all BUNs that have tail values: {v| low <{=} v <{=} high}.	Boundary inclusion is indicated separately.	NIL boundary values have a special meaning.	+ low  == nil means: no lower bound	+ high == nil means: no upper bound.";command select(b:bat[:any_1,:any_2],value:any_2) :bat[:any_1,:any_2] address ALGselect1comment "Select all BUNs of a BAT with a certain 	tail value. Selection on NIL is also 	possible (it should be properly casted, 	e.g.:int(nil)).";command selectNotNil(b:bat[:any_1,:any_2]):bat[:any_1,:any_2]address ALGselectNotNilcomment "Select all not-nil values";#line 136 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command selectH(b:bat[:any_1,:any_2], low:any_1, high:any_1) 			:bat[:any_1,:any_2] address ALGselectHead;command selectH(b:bat[:any_1,:any_2], low:any_1, 	high:any_1, li:bit, hi:bit) :bat[:any_1,:any_2] address ALGselectInclusiveHead;command selectH(b:bat[:any_1,:any_2],value:any_1) :bat[:any_1,:any_2] address ALGselect1Head;#line 149 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command select(b:bat[:any_2,:void], low:any_2) 		:bat[:any_2,:void] address ALGselect1Head;command select(b:bat[:any_2,:void], low:any_2, high:any_2) 		:bat[:any_2,:void] address ALGselectHead;command select(b:bat[:any_2,:void], low:any_2, high:any_2,li:bit, hi:bit) 		:bat[:any_2,:void] address ALGselectInclusiveHead;#line 162 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command fragment ( b:bat[:any_1,:any_2], hlow:any_1, hhigh:any_1,		tlow:any_2, thigh:any_2 ) :bat[:any_1,:any_2] address ALGfragmentcomment "Select both on head and tail range.";command slice(b:bat[:any_1,:any_2], x:lng, y:lng) :bat[:any_1,:any_2] address ALGslicecomment "Return the slice with the BUNs at position x till y.";command slice(b:bat[:any_1,:any_2], x:int, y:int) :bat[:any_1,:any_2] address ALGslice_intcomment "Return the slice with the BUNs at position x till y.";command topN( b:bat[:any_1,:any_2], top:lng ) :bat[:any_1,:any_2]address ALGtopNcomment "Trim all but the top N tuples.";command groupby(b:bat[:any_1,:int]) :bat[:any_1,:oid] address ALGgroupbycomment "Produces a new BAT with groups identified by the head column. The result contains tail times the head value, ie the tail contains the result group sizes.";command uselect(b:bat[:any_1,:any_2], low:any_2, high:any_2, 		li:bit, hi:bit) :bat[:any_1,:oid] address ALGuselectInclusivecomment "See select() but limited to head values";command uselect(b:bat[:any_1,:any_2], low:any_2, high:any_2):bat[:any_1,:oid] address ALGuselect;command uselect(b:bat[:any_1,:any_2], value:any_2) :bat[:any_1,:oid] address ALGuselect1comment "Value select, but returning only the 	head values. SEE ALSO:select(bat,val)";#line 197 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command like(b:bat[:any_1,:str], substr:str) :bat[:any_1,:str]address ALGlikecomment "Selects all elements that have 'substr' as in the tail.";#line 203 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command sample ( b:bat[:oid,:any_2], num:int ) :bat[:oid,:any_2] address ALGsamplecomment "Produce a random selection of size 'num' from the input BAT.";#line 208 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command copy( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] address ALGcopycomment "Returns physical copy of a BAT.";#line 213 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command sort( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] address ALGhsortcomment "Returns a BAT copy sorted on the head column.";command sortReverse( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] address ALGhsort_revcomment "Returns a BAT copy reversely sorted on the tail column.";command sortTail( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] address ALGtsortcomment "Returns a BAT copy sorted on the tail column.";command sortReverseTail( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] address ALGtsort_revcomment "Returns a BAT copy reversely sorted on the tail column.";command sortHT( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] address ALGhtsortcomment "Returns a lexicographically sorted copy on head,tail.";command sortTH( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] address ALGthsortcomment "Returns a lexicographically sorted copy on tail,head.";command ssort( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2]address ALGssortcomment "Returns copy of a BAT with the BUNs sorted on ascending head values.         This is a stable sort.";command ssort_rev( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2]address ALGssort_revcomment "Returns copy of a BAT with the BUNs sorted on descending head values.         This is a stable sort.";command revert( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2]address ALGrevertcomment "Returns a BAT copy with buns in reverse order";#line 287 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command unique (b:bat[:any_1,:any_2] ) :bat[:any_1,:any_2] address ALGsunique;command sunique (b:bat[:any_1,:any_2] ) :bat[:any_1,:any_2] address ALGsuniquecomment "Select unique tuples from the input BAT. Double elimination is 		done over BUNs as a whole (head and tail).  Result is a BAT 	with real set() semantics.";#line 296 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command kunique ( b:bat[:any_1,:any_2] ) :bat[:any_1,:any_2] address ALGkuniquecomment "Select unique tuples from the input BAT.  Double elimination is 		done only looking at the head column. The result is a BAT with		property hkeyed() == true.";command tunique (b:bat[:any_1,:any_2] ) :bat[:any_1,:any_2] address ALGtuniquecomment "Select unique tuples from the input BAT. Double elimination is 		done over the BUNs tail. The result is a BAT with property		tkeyd()== true";#line 310 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command intersect ( left:bat[:any_1,:any_2], right:bat[:any_1,:any_2]) 		:bat[:any_1,:any_2] address ALGsintersect;command sintersect ( left:bat[:any_1,:any_2], right:bat[:any_1,:any_2]) 		:bat[:any_1,:any_2] address ALGsintersectcomment "Returns the intersection taken over *both* columns of two BATs. 		Results in all BUNs of 'left' that are also in 'right'. Does *not* 		do double-elimination over the 'left' BUNs, If you want this, use:	 'sintersect(sunique(left),sunique(right))' 	or: 'sunique(sintersect(left,right))'.";#line 324 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command semijoin( left:bat[:any_1,:any_2], right:bat[:any_1,:any] ) 		:bat[:any_1,:any_2] address ALGsemijoincomment "Returns the intersection taken over only the *head* columns of 		two BATs.  Results in all BUNs of 'left' that are also in 'right'. 		Does *not* do double-elimination over the 'left' BUNs. 		If you want this, use: 'kintersect(kunique(left),kunique(right))' 	or: 'kunique(kintersect(left,right))'.";command kintersect( left:bat[:any_1,:any_2], right:bat[:any_1,:any] ) 		:bat[:any_1,:any_2] address ALGsemijoincomment "Returns the intersection taken over only the *head* columns of two BATs. 	Results in all BUNs of 'left' that are also in 'right'. 		Does *not* do double- elimination over the 'left' BUNs.		If you want this, use: 'kintersect(kunique(left),kunique(right))' 	or: 'kunique(kintersect(left,right))'.";#line 343 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command difference( left:bat[:any_1,:any_2], right:bat[:any_1,:any_2] ) 		:bat[:any_1,:any_2] address ALGsdiff;command sdifference( left:bat[:any_1,:any_2], right:bat[:any_1,:any_2] ) 		:bat[:any_1,:any_2] address ALGsdiffcomment "Returns the difference taken over *both* columns of two BATs. 		Results in all BUNs of 'left' that are *not* in 'right'. 		Does *not* do double-elimination over the 'left' BUNs. 		If you want this, use:		 'sdifference(left.sunique,right.sunique)' 	or: 'sdifference(left,right).sunique'.";#line 357 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command kdifference ( left:bat[:any_1,:any_2], right:bat[:any_1,:any] ) 		:bat[:any_1,:any_2] address ALGkdiffcomment "Returns the difference taken over only the *head* columns of two BATs. 		Results in all BUNs of 'left' that are *not* in 'right'. 		It does *not* do double-elimination over the 'left' BUNs. 		If you want this, use:	 'kdifference(left.kunique,right.kunique)' 	or: 'kdifference(left,right).kunique'.";#line 368 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/kernel/algebra.mx"command union ( left:bat[:any_1,:any_2], right:bat[:any_1,:any_2]) 		:bat[:any_1,:any_2] address ALGsunion;command sunion ( left:bat[:any_1,:any_2], right:bat[:any_1,:any_2]) 		:bat[:any_1,:any_2] address ALGsunioncomment "Returns the union of two BATs; looking at both columns of both BATs.		Results in all BUNs of 'left' that are  not in 'right', plus all 		BUNs of 'right'.  *no* double-elimination is done. 		If you want this, do:	 'sunion(left.sunique,right.sunique)' 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -