Sql

Sql module

MODULE sql;

UNSAFE PATTERN sql.affectedRows(X_0:int, X_1:lng):int;
COMMENT "export the number of affected rows by the current query";

PATTERN sql.all(X_0:bit, X_1:bit, X_2:bit):bit;
COMMENT "if !cmp then false, (nl or nr) then nil, else true";

COMMAND sql.alpha(X_0:dbl, X_1:dbl):dbl;
COMMENT "Implementation of astronomy alpha function: expands the radius theta depending on the declination";

UNSAFE PATTERN sql.analyze():void;
COMMENT "Update statistics for every column in the database";

UNSAFE PATTERN sql.analyze(X_0:str):void;
COMMENT "Update statistics for schema";

UNSAFE PATTERN sql.analyze(X_0:str, X_1:str):void;
COMMENT "Update statistics for table";

UNSAFE PATTERN sql.analyze(X_0:str, X_1:str, X_2:str):void;
COMMENT "Update statistics for column";

PATTERN sql.any(X_0:bit, X_1:bit, X_2:bit):bit;
COMMENT "if cmp then true, (nl or nr) nil then nil, else false";

PATTERN sql.append(X_0:int, X_1:str, X_2:str, X_3:str, X_4:oid, X_5:bat[:oid], X_6:any):int;
COMMENT "Append to the column tname.cname (possibly optimized to replace the insert bat of tname.cname. Returns sequence number for order dependence.";

PATTERN sql.argRecord():str;
COMMENT "Glue together the calling sequence";

PATTERN sql.argRecord(X_0:any...):str;
COMMENT "Glue together the calling sequence";

PATTERN sql.assert(X_0:bit, X_1:str):void;
COMMENT "Generate an exception when b==true";

PATTERN sql.assert(X_0:int, X_1:str):void;
COMMENT "Generate an exception when b!=0";

PATTERN sql.assert(X_0:lng, X_1:str):void;
COMMENT "Generate an exception when b!=0";

PATTERN sql.avg(X_0:bte, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the average of groups";

PATTERN sql.avg(X_0:dbl, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the average of groups";

PATTERN sql.avg(X_0:flt, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the average of groups";

PATTERN sql.avg(X_0:int, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the average of groups";

PATTERN sql.avg(X_0:lng, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the average of groups";

PATTERN sql.avg(X_0:sht, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the average of groups";

PATTERN sql.avg(X_0:bte, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):bte;
COMMENT "return the average of groups";

PATTERN sql.avg(X_0:int, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):int;
COMMENT "return the average of groups";

PATTERN sql.avg(X_0:lng, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):lng;
COMMENT "return the average of groups";

PATTERN sql.avg(X_0:sht, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):sht;
COMMENT "return the average of groups";

PATTERN sql.bind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int) (X_5:bat[:oid], X_6:bat[:any_1]);
COMMENT "Bind the 'schema.table.column' BAT with access kind:\n0 - base table\n1 - inserts\n2 - updates";

PATTERN sql.bind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int):bat[:any_1];
COMMENT "Bind the 'schema.table.column' BAT with access kind:\n0 - base table\n1 - inserts\n2 - updates";

PATTERN sql.bind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int) (X_7:bat[:oid], X_8:bat[:any_1]);
COMMENT "Bind the 'schema.table.column' BAT with access kind:\n0 - base table\n1 - inserts\n2 - updates";

PATTERN sql.bind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int):bat[:any_1];
COMMENT "Bind the 'schema.table.column' BAT partition with access kind:\n0 - base table\n1 - inserts\n2 - updates";

PATTERN sql.bind_idxbat(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int) (X_5:bat[:oid], X_6:bat[:any_1]);
COMMENT "Bind the 'schema.table.index' BAT with access kind:\n0 - base table\n1 - inserts\n2 - updates";

PATTERN sql.bind_idxbat(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int):bat[:any_1];
COMMENT "Bind the 'schema.table.index' BAT with access kind:\n0 - base table\n1 - inserts\n2 - updates";

PATTERN sql.bind_idxbat(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int) (X_7:bat[:oid], X_8:bat[:any_1]);
COMMENT "Bind the 'schema.table.index' BAT with access kind:\n0 - base table\n1 - inserts\n2 - updates";

PATTERN sql.bind_idxbat(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int):bat[:any_1];
COMMENT "Bind the 'schema.table.index' BAT with access kind:\n0 - base table\n1 - inserts\n2 - updates";

UNSAFE PATTERN sql.claim(X_0:int, X_1:str, X_2:str, X_3:lng) (X_4:oid, X_5:bat[:oid]);
COMMENT "Claims slots for appending rows.";

UNSAFE PATTERN sql.clear_table(X_0:str, X_1:str, X_2:int):lng;
COMMENT "Clear the table sname.tname.";

UNSAFE PATTERN sql.copy_from(X_0:ptr, X_1:str, X_2:str, X_3:str, X_4:str, X_5:str, X_6:lng, X_7:lng, X_8:int, X_9:str, X_10:int, X_11:int):bat[:any]...;
COMMENT "Import a table from bstream s with the \ngiven tuple and seperators (sep/rsep)";

PATTERN sql.copy_rejects() (X_0:bat[:lng], X_1:bat[:int], X_2:bat[:str], X_3:bat[:str]);
COMMENT "";

UNSAFE PATTERN sql.copy_rejects_clear():void;
COMMENT "";

PATTERN sql.corr(X_0:bte, X_1:bte, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the correlation value of groups";

PATTERN sql.corr(X_0:dbl, X_1:dbl, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the correlation value of groups";

PATTERN sql.corr(X_0:flt, X_1:flt, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the correlation value of groups";

PATTERN sql.corr(X_0:int, X_1:int, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the correlation value of groups";

PATTERN sql.corr(X_0:lng, X_1:lng, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the correlation value of groups";

PATTERN sql.corr(X_0:sht, X_1:sht, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the correlation value of groups";

PATTERN sql.count(X_0:str, X_1:str):lng;
COMMENT "return count of basetable";

PATTERN sql.count(X_0:any_1, X_1:bit, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):lng;
COMMENT "return count of groups";

PATTERN sql.covariance(X_0:bte, X_1:bte, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance sample value of groups";

PATTERN sql.covariance(X_0:dbl, X_1:dbl, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance sample value of groups";

PATTERN sql.covariance(X_0:flt, X_1:flt, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance sample value of groups";

PATTERN sql.covariance(X_0:int, X_1:int, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance sample value of groups";

PATTERN sql.covariance(X_0:lng, X_1:lng, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance sample value of groups";

PATTERN sql.covariance(X_0:sht, X_1:sht, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance sample value of groups";

PATTERN sql.covariancep(X_0:bte, X_1:bte, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance population value of groups";

PATTERN sql.covariancep(X_0:dbl, X_1:dbl, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance population value of groups";

PATTERN sql.covariancep(X_0:flt, X_1:flt, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance population value of groups";

PATTERN sql.covariancep(X_0:int, X_1:int, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance population value of groups";

PATTERN sql.covariancep(X_0:lng, X_1:lng, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance population value of groups";

PATTERN sql.covariancep(X_0:sht, X_1:sht, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):dbl;
COMMENT "return the covariance population value of groups";

UNSAFE PATTERN sql.createorderindex(X_0:str, X_1:str, X_2:str):void;
COMMENT "Instantiate the order index on a column";

UNSAFE PATTERN sql.createstrimps(X_0:str, X_1:str, X_2:str):void;
COMMENT "Instantiate the strimps index on a column";

PATTERN sql.cume_dist(X_0:any_1, X_1:bit, X_2:bit):dbl;
COMMENT "return the accumulated distribution of the number of rows per group to the total number of partition rows";

PATTERN sql.current_time():daytime;
COMMENT "Get the clients current daytime";

PATTERN sql.current_timestamp():timestamp;
COMMENT "Get the clients current timestamp";

COMMAND sql.date_trunc(X_0:str, X_1:bat[:timestamp]):bat[:timestamp];
COMMENT "Truncate a timestamp to (millennium, century,decade,year,quarter,month,week,day,hour,minute,second, milliseconds,microseconds)";

COMMAND sql.date_trunc(X_0:str, X_1:timestamp):timestamp;
COMMENT "Truncate a timestamp to (millennium, century,decade,year,quarter,month,week,day,hour,minute,second, milliseconds,microseconds)";

UNSAFE PATTERN sql.delete(X_0:int, X_1:str, X_2:str, X_3:any):int;
COMMENT "Delete a row from a table. Returns sequence number for order dependence.";

COMMAND sql.delta(X_0:bat[:any_3], X_1:bat[:oid], X_2:bat[:any_3]):bat[:any_3];
COMMENT "Return column bat with delta's applied.";

PATTERN sql.deltas(X_0:str) (X_1:bat[:int], X_2:bat[:lng], X_3:bat[:lng], X_4:bat[:lng], X_5:bat[:lng], X_6:bat[:lng], X_7:bat[:int]);
COMMENT "Return the delta values sizes of all columns of the schema's tables, plus the current transaction level";

PATTERN sql.deltas(X_0:str, X_1:str) (X_2:bat[:int], X_3:bat[:lng], X_4:bat[:lng], X_5:bat[:lng], X_6:bat[:lng], X_7:bat[:lng], X_8:bat[:int]);
COMMENT "Return the delta values sizes from the table's columns, plus the current transaction level";

PATTERN sql.deltas(X_0:str, X_1:str, X_2:str) (X_3:bat[:int], X_4:bat[:lng], X_5:bat[:lng], X_6:bat[:lng], X_7:bat[:lng], X_8:bat[:lng], X_9:bat[:int]);
COMMENT "Return the delta values sizes of a column, plus the current transaction level";

PATTERN sql.dense_rank(X_0:any_1, X_1:bit, X_2:bit):int;
COMMENT "return the densely ranked groups";

UNSAFE PATTERN sql.depend(X_0:str, X_1:str, X_2:lng):void;
COMMENT "Set dml dependency on current transaction for a table.";

UNSAFE PATTERN sql.deregister():int;
COMMENT "Finish running transaction";

PATTERN sql.diff(X_0:any_1):bit;
COMMENT "return true if cur != prev row";

PATTERN sql.diff(X_0:bit, X_1:any_1):bit;
COMMENT "return true if cur != prev row";

UNSAFE PATTERN sql.drop_hash(X_0:str, X_1:str):void;
COMMENT "Drop hash indices for the given table";

UNSAFE PATTERN sql.droporderindex(X_0:str, X_1:str, X_2:str):void;
COMMENT "Drop the order index on a column";

PATTERN sql.dump_cache() (X_0:bat[:str], X_1:bat[:int]);
COMMENT "dump the content of the query cache";

PATTERN sql.dump_opt_stats() (X_0:bat[:str], X_1:bat[:int]);
COMMENT "dump the optimizer rewrite statistics";

PATTERN sql.dump_trace() (X_0:bat[:lng], X_1:bat[:str], X_2:bat[:str]);
COMMENT "dump the trace statistics";

PATTERN sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int) (X_5:bat[:oid], X_6:bat[:any_1]);
COMMENT "";

PATTERN sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int):bat[:any_1];
COMMENT "";

PATTERN sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int) (X_7:bat[:oid], X_8:bat[:any_1]);
COMMENT "";

PATTERN sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int):bat[:any_1];
COMMENT "";

PATTERN sql.emptybindidx(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int) (X_5:bat[:oid], X_6:bat[:any_1]);
COMMENT "";

PATTERN sql.emptybindidx(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int):bat[:any_1];
COMMENT "";

PATTERN sql.emptybindidx(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int) (X_7:bat[:oid], X_8:bat[:any_1]);
COMMENT "";

PATTERN sql.emptybindidx(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int, X_5:int, X_6:int):bat[:any_1];
COMMENT "";

COMMAND sql.epilogue():void;
COMMENT "";

UNSAFE PATTERN sql.eval(X_0:str):void;
COMMENT "Compile and execute a single sql statement";

UNSAFE PATTERN sql.eval(X_0:str, X_1:bit):void;
COMMENT "Compile and execute a single sql statement (and optionaly set the output to columnar format)";

UNSAFE PATTERN sql.evalAlgebra(X_0:str, X_1:bit):void;
COMMENT "Compile and execute a single 'relational algebra' statement";

UNSAFE PATTERN sql.exportChunk(X_0:streams, X_1:int):void;
COMMENT "Export a chunk of the result set (in order) to stream s";

UNSAFE PATTERN sql.exportChunk(X_0:streams, X_1:int, X_2:int, X_3:int):void;
COMMENT "Export a chunk of the result set (in order) to stream s";

UNSAFE PATTERN sql.exportHead(X_0:streams, X_1:int):void;
COMMENT "Export a result (in order) to stream s";

UNSAFE PATTERN sql.exportOperation():void;
COMMENT "Export result of schema/transaction queries";

UNSAFE PATTERN sql.exportResult(X_0:streams, X_1:int):void;
COMMENT "Export a result (in order) to stream s";

UNSAFE PATTERN sql.export_table(X_0:str, X_1:str, X_2:str, X_3:str, X_4:str, X_5:str, X_6:int, X_7:bat[:str], X_8:bat[:str], X_9:bat[:str], X_10:bat[:int], X_11:bat[:int], X_12:any...):int;
COMMENT "Prepare a table result set for the COPY INTO stream";

UNSAFE PATTERN sql.export_table(X_0:str, X_1:str, X_2:str, X_3:str, X_4:str, X_5:str, X_6:int, X_7:bat[:str], X_8:bat[:str], X_9:bat[:str], X_10:bat[:int], X_11:bat[:int], X_12:bat[:any]...):int;
COMMENT "Prepare a table result set for the COPY INTO stream";

PATTERN sql.first_value(X_0:any_1, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):any_1;
COMMENT "return the first value of groups";

PATTERN sql.getVariable(X_0:int, X_1:str, X_2:str):any_1;
COMMENT "Get the value of a session variable";

COMMAND sql.getVersion(X_0:int):lng;
COMMENT "Return the database version identifier for a client.";

PATTERN sql.get_value(X_0:str, X_1:str):lng;
COMMENT "return the current value of the sequence (ie the next to be used value)";

PATTERN sql.grow(X_0:bat[:oid], X_1:any_1):int;
COMMENT "Resize the tid column of a declared table.";

UNSAFE PATTERN sql.hot_snapshot(X_0:str):void;
COMMENT "Write db snapshot to the given tar(.gz) file";

UNSAFE PATTERN sql.hot_snapshot(X_0:str, X_1:bit):void;
COMMENT "Write db snapshot to the given tar(.gz/.lz4/.bz/.xz) file on either server or client";

PATTERN sql.importColumn(X_0:str, X_1:bit, X_2:str, X_3:int, X_4:oid) (X_5:bat[:any], X_6:oid);
COMMENT "Import a column from the given file";

UNSAFE PATTERN sql.importTable(X_0:str, X_1:str, X_2:int, X_3:bit, X_4:str...):bat[:any]...;
COMMENT "Import a table from the files (fname)";

UNSAFE PATTERN sql.include(X_0:str):void;
COMMENT "Compile and execute a sql statements on the file";

PATTERN sql.lag(X_0:any_1, X_1:any, X_2:any_1, X_3:bit, X_4:bit):any_1;
COMMENT "return the value in the previous 'l' row in the partition or 'd' if non existent";

PATTERN sql.lag(X_0:any_1, X_1:any, X_2:bit, X_3:bit):any_1;
COMMENT "return the value in the previous 'l' row in the partition or NULL if non existent";

PATTERN sql.lag(X_0:any_1, X_1:bit, X_2:bit):any_1;
COMMENT "return the value in the previous row in the partition or NULL if non existent";

PATTERN sql.last_value(X_0:any_1, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):any_1;
COMMENT "return the last value of groups";

PATTERN sql.lead(X_0:any_1, X_1:any, X_2:any_1, X_3:bit, X_4:bit):any_1;
COMMENT "return the value in the next 'l' row in the partition or 'd' if non existent";

PATTERN sql.lead(X_0:any_1, X_1:any, X_2:bit, X_3:bit):any_1;
COMMENT "return the value in the next 'l' row in the partition or NULL if non existent";

PATTERN sql.lead(X_0:any_1, X_1:bit, X_2:bit):any_1;
COMMENT "return the value in the next row in the partition or NULL if non existent";

UNSAFE PATTERN sql.logfile(X_0:str):void;
COMMENT "Enable/disable saving the sql statement traces";

PATTERN sql.max(X_0:any_1, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):any_1;
COMMENT "return the maximum of groups";

PATTERN sql.min(X_0:any_1, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):any_1;
COMMENT "return the minimum of groups";

COMMAND sql.ms_trunc(X_0:dbl, X_1:int):dbl;
COMMENT "truncate the floating point v to r digits behind the dot (if r < 0, before the dot)";

COMMAND sql.ms_trunc(X_0:flt, X_1:int):flt;
COMMENT "truncate the floating point v to r digits behind the dot (if r < 0, before the dot)";

PATTERN sql.mvc():int;
COMMENT "Get the multiversion catalog context. \nNeeded for correct statement dependencies\n(ie sql.update, should be after sql.bind in concurrent execution)";

UNSAFE PATTERN sql.next_value(X_0:str, X_1:str):lng;
COMMENT "return the next value of the sequence";

PATTERN sql.nth_value(X_0:any_1, X_1:lng, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):any_1;
COMMENT "return the nth value of each group";

PATTERN sql.ntile(X_0:any, X_1:any_1, X_2:bit, X_3:bit):any_1;
COMMENT "return the groups divided as equally as possible";

PATTERN sql.optimizer_updates():void;
COMMENT "";

COMMAND sql.optimizers() (X_0:bat[:str], X_1:bat[:str], X_2:bat[:str]);
COMMENT "";

PATTERN sql.password(X_0:str):str;
COMMENT "Return password hash of user";

PATTERN sql.percent_rank(X_0:any_1, X_1:bit, X_2:bit):dbl;
COMMENT "return the percentage into the total number of groups for each row";

UNSAFE PATTERN sql.predicate(X_0:str, X_1:str, X_2:str):void;
COMMENT "Add predicate on current transaction for a table column.";

PATTERN sql.prelude():void;
COMMENT "";

PATTERN sql.prepared_statements() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:int], X_3:bat[:str], X_4:bat[:timestamp]);
COMMENT "Available prepared statements in the current session";

PATTERN sql.prepared_statements_args() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:int], X_3:bat[:int], X_4:bat[:bte], X_5:bat[:int], X_6:bat[:str], X_7:bat[:str], X_8:bat[:str]);
COMMENT "Available prepared statements' arguments in the current session";

PATTERN sql.prod(X_0:bte, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):lng;
COMMENT "return the product of groups";

PATTERN sql.prod(X_0:dbl, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the product of groups";

PATTERN sql.prod(X_0:flt, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the product of groups";

PATTERN sql.prod(X_0:flt, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):flt;
COMMENT "return the product of groups";

PATTERN sql.prod(X_0:int, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):lng;
COMMENT "return the product of groups";

PATTERN sql.prod(X_0:lng, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):lng;
COMMENT "return the product of groups";

PATTERN sql.prod(X_0:sht, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):lng;
COMMENT "return the product of groups";

COMMAND sql.project(X_0:bat[:oid], X_1:bat[:oid], X_2:bat[:oid]):bat[:oid];
COMMENT "Last step of a left outer join, ie project the inner join (l,r) over the left input side (col)";

COMMAND sql.projectdelta(X_0:bat[:oid], X_1:bat[:any_3], X_2:bat[:oid], X_3:bat[:any_3]):bat[:any_3];
COMMENT "Return column bat with delta's applied.";

PATTERN sql.querylog_calls() (X_0:bat[:oid], X_1:bat[:timestamp], X_2:bat[:timestamp], X_3:bat[:str], X_4:bat[:lng], X_5:bat[:lng], X_6:bat[:lng], X_7:bat[:int], X_8:bat[:int]);
COMMENT "Obtain the query log calls";

PATTERN sql.querylog_catalog() (X_0:bat[:oid], X_1:bat[:str], X_2:bat[:timestamp], X_3:bat[:str], X_4:bat[:str], X_5:bat[:str], X_6:bat[:int], X_7:bat[:lng]);
COMMENT "Obtain the query log catalog";

UNSAFE COMMAND sql.querylog_disable():void;
COMMENT "";

UNSAFE PATTERN sql.querylog_empty():void;
COMMENT "";

UNSAFE COMMAND sql.querylog_enable():void;
COMMENT "";

UNSAFE COMMAND sql.querylog_enable(X_0:int):void;
COMMENT "";

PATTERN sql.rank(X_0:any_1, X_1:bit, X_2:bit):int;
COMMENT "return the ranked groups";

UNSAFE PATTERN sql.register(X_0:str, X_1:str, X_2:str, X_3:str):int;
COMMENT "";

UNSAFE PATTERN sql.register(X_0:str, X_1:str, X_2:str, X_3:str, X_4:str):int;
COMMENT "Compile the relational statement (rel_smt) and register it as mal function, mod.fname(signature)";

UNSAFE PATTERN sql.restart(X_0:str, X_1:str, X_2:lng):lng;
COMMENT "restart the sequence with value start";

UNSAFE PATTERN sql.resultSet(X_0:bat[:str], X_1:bat[:str], X_2:bat[:str], X_3:bat[:int], X_4:bat[:int], X_5:any...):int;
COMMENT "Prepare a table result set for the client front-end";

UNSAFE PATTERN sql.resultSet(X_0:str, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, X_6:any):int;
COMMENT "Prepare a table result set for the client front-end.";

UNSAFE PATTERN sql.resultSet(X_0:bat[:str], X_1:bat[:str], X_2:bat[:str], X_3:bat[:int], X_4:bat[:int], X_5:bat[:any]...):int;
COMMENT "Prepare a table result set for the client in default CSV format";

UNSAFE PATTERN sql.resume_log_flushing():void;
COMMENT "Resume WAL log flushing";

PATTERN sql.row_number(X_0:any_1, X_1:bit, X_2:bit):int;
COMMENT "return the row_numer-ed groups";

PATTERN sql.rt_credentials(X_0:str) (X_1:bat[:str], X_2:bat[:str], X_3:bat[:str]);
COMMENT "Return the remote table credentials for the given table";

PATTERN sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], X_7:bat[:int], X_8:bat[:int]);
COMMENT "SQL export table of active sessions, their timeouts and idle status";

UNSAFE PATTERN sql.setVariable(X_0:int, X_1:str, X_2:str, X_3:any_1):int;
COMMENT "Set the value of a session variable";

UNSAFE PATTERN sql.set_protocol(X_0:int):int;
COMMENT "Configures the result set protocol";

UNSAFE PATTERN sql.shutdown(X_0:bte):str;
COMMENT "";

UNSAFE PATTERN sql.shutdown(X_0:bte, X_1:bit):str;
COMMENT "";

UNSAFE PATTERN sql.shutdown(X_0:int):str;
COMMENT "";

UNSAFE PATTERN sql.shutdown(X_0:int, X_1:bit):str;
COMMENT "";

UNSAFE PATTERN sql.shutdown(X_0:sht):str;
COMMENT "";

UNSAFE PATTERN sql.shutdown(X_0:sht, X_1:bit):str;
COMMENT "";

PATTERN sql.sql_variables() (X_0:bat[:str], X_1:bat[:str], X_2:bat[:str], X_3:bat[:str]);
COMMENT "return the table with session variables";

PATTERN sql.statistics() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:str], X_3:bat[:str], X_4:bat[:str], X_5:bat[:int], X_6:bat[:lng], X_7:bat[:bit], X_8:bat[:bit], X_9:bat[:str], X_10:bat[:str], X_11:bat[:bit], X_12:bat[:bit]);
COMMENT "return a table with statistics information";

PATTERN sql.statistics(X_0:str) (X_1:bat[:int], X_2:bat[:str], X_3:bat[:str], X_4:bat[:str], X_5:bat[:str], X_6:bat[:int], X_7:bat[:lng], X_8:bat[:bit], X_9:bat[:bit], X_10:bat[:str], X_11:bat[:str], X_12:bat[:bit], X_13:bat[:bit]);
COMMENT "return a table with statistics information for a particular schema";

PATTERN sql.statistics(X_0:str, X_1:str) (X_2:bat[:int], X_3:bat[:str], X_4:bat[:str], X_5:bat[:str], X_6:bat[:str], X_7:bat[:int], X_8:bat[:lng], X_9:bat[:bit], X_10:bat[:bit], X_11:bat[:str], X_12:bat[:str], X_13:bat[:bit], X_14:bat[:bit]);
COMMENT "return a table with statistics information for a particular table";

PATTERN sql.statistics(X_0:str, X_1:str, X_2:str) (X_3:bat[:int], X_4:bat[:str], X_5:bat[:str], X_6:bat[:str], X_7:bat[:str], X_8:bat[:int], X_9:bat[:lng], X_10:bat[:bit], X_11:bat[:bit], X_12:bat[:str], X_13:bat[:str], X_14:bat[:bit], X_15:bat[:bit]);
COMMENT "return a table with statistics information for a particular column";

PATTERN sql.stdev(X_0:bte, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation sample of groups";

PATTERN sql.stdev(X_0:dbl, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation sample of groups";

PATTERN sql.stdev(X_0:flt, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation sample of groups";

PATTERN sql.stdev(X_0:int, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation sample of groups";

PATTERN sql.stdev(X_0:lng, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation sample of groups";

PATTERN sql.stdev(X_0:sht, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation sample of groups";

PATTERN sql.stdevp(X_0:bte, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation population of groups";

PATTERN sql.stdevp(X_0:dbl, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation population of groups";

PATTERN sql.stdevp(X_0:flt, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation population of groups";

PATTERN sql.stdevp(X_0:int, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation population of groups";

PATTERN sql.stdevp(X_0:lng, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation population of groups";

PATTERN sql.stdevp(X_0:sht, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the standard deviation population of groups";

UNSAFE PATTERN sql.stop_vacuum(X_0:str, X_1:str, X_2:str):void;
COMMENT "stop auto vacuum";

PATTERN sql.storage() (X_0:bat[:str], X_1:bat[:str], X_2:bat[:str], X_3:bat[:str], X_4:bat[:str], X_5:bat[:str], X_6:bat[:lng], X_7:bat[:int], X_8:bat[:lng], X_9:bat[:lng], X_10:bat[:lng], X_11:bat[:bit], X_12:bat[:lng], X_13:bat[:bit], X_14:bat[:bit], X_15:bat[:bit], X_16:bat[:lng]);
COMMENT "return a table with storage information";

PATTERN sql.storage(X_0:str) (X_1:bat[:str], X_2:bat[:str], X_3:bat[:str], X_4:bat[:str], X_5:bat[:str], X_6:bat[:str], X_7:bat[:lng], X_8:bat[:int], X_9:bat[:lng], X_10:bat[:lng], X_11:bat[:lng], X_12:bat[:bit], X_13:bat[:lng], X_14:bat[:bit], X_15:bat[:bit], X_16:bat[:bit], X_17:bat[:lng]);
COMMENT "return a table with storage information for a particular schema";

PATTERN sql.storage(X_0:str, X_1:str) (X_2:bat[:str], X_3:bat[:str], X_4:bat[:str], X_5:bat[:str], X_6:bat[:str], X_7:bat[:str], X_8:bat[:lng], X_9:bat[:int], X_10:bat[:lng], X_11:bat[:lng], X_12:bat[:lng], X_13:bat[:bit], X_14:bat[:lng], X_15:bat[:bit], X_16:bat[:bit], X_17:bat[:bit], X_18:bat[:lng]);
COMMENT "return a table with storage information for a particular table";

PATTERN sql.storage(X_0:str, X_1:str, X_2:str) (X_3:bat[:str], X_4:bat[:str], X_5:bat[:str], X_6:bat[:str], X_7:bat[:str], X_8:bat[:str], X_9:bat[:lng], X_10:bat[:int], X_11:bat[:lng], X_12:bat[:lng], X_13:bat[:lng], X_14:bat[:bit], X_15:bat[:lng], X_16:bat[:bit], X_17:bat[:bit], X_18:bat[:bit], X_19:bat[:lng]);
COMMENT "return a table with storage information for a particular column";

PATTERN sql.str_group_concat(X_0:str, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):str;
COMMENT "return the string concatenation of groups";

PATTERN sql.str_group_concat(X_0:str, X_1:str, X_2:bit, X_3:bit, X_4:int, X_5:oid, X_6:oid):str;
COMMENT "return the string concatenation of groups with a custom separator";

COMMAND sql.subdelta(X_0:bat[:oid], X_1:bat[:oid], X_2:bat[:oid], X_3:bat[:oid]):bat[:oid];
COMMENT "Return a single bat of selected delta.";

PATTERN sql.sum(X_0:bte, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):lng;
COMMENT "return the sum of groups";

PATTERN sql.sum(X_0:dbl, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the sum of groups";

PATTERN sql.sum(X_0:flt, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the sum of groups";

PATTERN sql.sum(X_0:flt, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):flt;
COMMENT "return the sum of groups";

PATTERN sql.sum(X_0:int, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):int;
COMMENT "return the sum of groups";

PATTERN sql.sum(X_0:int, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):lng;
COMMENT "return the sum of groups";

PATTERN sql.sum(X_0:lng, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):lng;
COMMENT "return the sum of groups";

PATTERN sql.sum(X_0:sht, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):lng;
COMMENT "return the sum of groups";

UNSAFE PATTERN sql.suspend_log_flushing():void;
COMMENT "Suspend WAL log flushing";

PATTERN sql.tid(X_0:int, X_1:str, X_2:str):bat[:oid];
COMMENT "Return a column with the valid tuple identifiers associated with the table sname.tname.";

PATTERN sql.tid(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int):bat[:oid];
COMMENT "Return the tables tid column.";

UNSAFE PATTERN sql.transaction_begin(X_0:int, X_1:str):void;
COMMENT "A transaction statement (type can be commit,release,rollback or start)";

UNSAFE PATTERN sql.transaction_commit(X_0:int, X_1:str):void;
COMMENT "A transaction statement (type can be commit,release,rollback or start)";

UNSAFE PATTERN sql.transaction_release(X_0:int, X_1:str):void;
COMMENT "A transaction statement (type can be commit,release,rollback or start)";

UNSAFE PATTERN sql.transaction_rollback(X_0:int, X_1:str):void;
COMMENT "A transaction statement (type can be commit,release,rollback or start)";

PATTERN sql.unionfunc(X_0:str, X_1:str, X_2:any...):any...;
COMMENT "";

PATTERN sql.update(X_0:int, X_1:str, X_2:str, X_3:str, X_4:any, X_5:any):int;
COMMENT "Update the values of the column tname.cname. Returns sequence number for order dependence)";

UNSAFE PATTERN sql.update_schemas():void;
COMMENT "Procedure triggered on update of the sys.schemas table";

UNSAFE PATTERN sql.update_tables():void;
COMMENT "Procedure triggered on update of the sys._tables table";

UNSAFE PATTERN sql.vacuum(X_0:str, X_1:str, X_2:str, X_3:int):void;
COMMENT "auto vacuum string column with interval(sec)";

UNSAFE PATTERN sql.vacuum(X_0:str, X_1:str, X_2:str):void;
COMMENT "vacuum a string column";

PATTERN sql.variance(X_0:bte, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance sample of groups";

PATTERN sql.variance(X_0:dbl, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance sample of groups";

PATTERN sql.variance(X_0:flt, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance sample of groups";

PATTERN sql.variance(X_0:int, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance sample of groups";

PATTERN sql.variance(X_0:lng, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance sample of groups";

PATTERN sql.variance(X_0:sht, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance sample of groups";

PATTERN sql.variancep(X_0:bte, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance population of groups";

PATTERN sql.variancep(X_0:dbl, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance population of groups";

PATTERN sql.variancep(X_0:flt, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance population of groups";

PATTERN sql.variancep(X_0:int, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance population of groups";

PATTERN sql.variancep(X_0:lng, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance population of groups";

PATTERN sql.variancep(X_0:sht, X_1:bit, X_2:bit, X_3:int, X_4:oid, X_5:oid):dbl;
COMMENT "return the variance population of groups";

PATTERN sql.window_bound(X_0:any_1, X_1:int, X_2:int, X_3:int, X_4:bte):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:any_1, X_1:int, X_2:int, X_3:int, X_4:dbl):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:any_1, X_1:int, X_2:int, X_3:int, X_4:flt):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:any_1, X_1:int, X_2:int, X_3:int, X_4:int):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:any_1, X_1:int, X_2:int, X_3:int, X_4:lng):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:any_1, X_1:int, X_2:int, X_3:int, X_4:sht):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:bit, X_1:any_1, X_2:int, X_3:int, X_4:int, X_5:bte):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:bit, X_1:any_1, X_2:int, X_3:int, X_4:int, X_5:dbl):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:bit, X_1:any_1, X_2:int, X_3:int, X_4:int, X_5:flt):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:bit, X_1:any_1, X_2:int, X_3:int, X_4:int, X_5:int):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:bit, X_1:any_1, X_2:int, X_3:int, X_4:int, X_5:lng):oid;
COMMENT "computes window ranges for each row";

PATTERN sql.window_bound(X_0:bit, X_1:any_1, X_2:int, X_3:int, X_4:int, X_5:sht):oid;
COMMENT "computes window ranges for each row";

Batsql module

MODULE batsql;

PATTERN batsql.all(X_0:bat[:bit], X_1:bat[:bit], X_2:bat[:bit]):bat[:bit];
COMMENT "if !cmp then false, (nl or nr) then nil, else true";

PATTERN batsql.all(X_0:bat[:bit], X_1:bat[:bit], X_2:bit):bat[:bit];
COMMENT "if !cmp then false, (nl or nr) then nil, else true";

PATTERN batsql.all(X_0:bat[:bit], X_1:bit, X_2:bat[:bit]):bat[:bit];
COMMENT "if !cmp then false, (nl or nr) then nil, else true";

PATTERN batsql.all(X_0:bat[:bit], X_1:bit, X_2:bit):bat[:bit];
COMMENT "if !cmp then false, (nl or nr) then nil, else true";

PATTERN batsql.all(X_0:bit, X_1:bat[:bit], X_2:bat[:bit]):bat[:bit];
COMMENT "if !cmp then false, (nl or nr) then nil, else true";

PATTERN batsql.all(X_0:bit, X_1:bat[:bit], X_2:bit):bat[:bit];
COMMENT "if !cmp then false, (nl or nr) then nil, else true";

PATTERN batsql.all(X_0:bit, X_1:bit, X_2:bat[:bit]):bat[:bit];
COMMENT "if !cmp then false, (nl or nr) then nil, else true";

COMMAND batsql.alpha(X_0:bat[:dbl], X_1:dbl):bat[:dbl];
COMMENT "BAT implementation of astronomy alpha function";

COMMAND batsql.alpha(X_0:dbl, X_1:bat[:dbl]):bat[:dbl];
COMMENT "BAT implementation of astronomy alpha function";

PATTERN batsql.any(X_0:bat[:bit], X_1:bat[:bit], X_2:bat[:bit]):bat[:bit];
COMMENT "if cmp then true, (nl or nr) nil then nil, else false";

PATTERN batsql.any(X_0:bat[:bit], X_1:bat[:bit], X_2:bit):bat[:bit];
COMMENT "if cmp then true, (nl or nr) nil then nil, else false";

PATTERN batsql.any(X_0:bat[:bit], X_1:bit, X_2:bat[:bit]):bat[:bit];
COMMENT "if cmp then true, (nl or nr) nil then nil, else false";

PATTERN batsql.any(X_0:bat[:bit], X_1:bit, X_2:bit):bat[:bit];
COMMENT "if cmp then true, (nl or nr) nil then nil, else false";

PATTERN batsql.any(X_0:bit, X_1:bat[:bit], X_2:bat[:bit]):bat[:bit];
COMMENT "if cmp then true, (nl or nr) nil then nil, else false";

PATTERN batsql.any(X_0:bit, X_1:bat[:bit], X_2:bit):bat[:bit];
COMMENT "if cmp then true, (nl or nr) nil then nil, else false";

PATTERN batsql.any(X_0:bit, X_1:bit, X_2:bat[:bit]):bat[:bit];
COMMENT "if cmp then true, (nl or nr) nil then nil, else false";

PATTERN batsql.avg(X_0:bat[:bte], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the average of groups";

PATTERN batsql.avg(X_0:bat[:dbl], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the average of groups";

PATTERN batsql.avg(X_0:bat[:flt], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the average of groups";

PATTERN batsql.avg(X_0:bat[:int], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the average of groups";

PATTERN batsql.avg(X_0:bat[:lng], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the average of groups";

PATTERN batsql.avg(X_0:bat[:sht], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the average of groups";

PATTERN batsql.avg(X_0:bat[:bte], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:bte];
COMMENT "return the average of groups";

PATTERN batsql.avg(X_0:bat[:int], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:int];
COMMENT "return the average of groups";

PATTERN batsql.avg(X_0:bat[:lng], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:lng];
COMMENT "return the average of groups";

PATTERN batsql.avg(X_0:bat[:sht], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:sht];
COMMENT "return the average of groups";

PATTERN batsql.corr(X_0:bat[:bte], X_1:bat[:bte], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:bte], X_1:bte, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:dbl], X_1:bat[:dbl], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:dbl], X_1:dbl, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:flt], X_1:bat[:flt], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:flt], X_1:flt, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:int], X_1:bat[:int], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:int], X_1:int, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:lng], X_1:bat[:lng], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:lng], X_1:lng, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:sht], X_1:bat[:sht], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bat[:sht], X_1:sht, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:bte, X_1:bat[:bte], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:dbl, X_1:bat[:dbl], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:flt, X_1:bat[:flt], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:int, X_1:bat[:int], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:lng, X_1:bat[:lng], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.corr(X_0:sht, X_1:bat[:sht], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the correlation value of groups";

PATTERN batsql.count(X_0:bat[:any_1], X_1:bit, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:lng];
COMMENT "return count of groups";

PATTERN batsql.covariance(X_0:bat[:bte], X_1:bat[:bte], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:bte], X_1:bte, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:dbl], X_1:bat[:dbl], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:dbl], X_1:dbl, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:flt], X_1:bat[:flt], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:flt], X_1:flt, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:int], X_1:bat[:int], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:int], X_1:int, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:lng], X_1:bat[:lng], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:lng], X_1:lng, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:sht], X_1:bat[:sht], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bat[:sht], X_1:sht, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:bte, X_1:bat[:bte], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:dbl, X_1:bat[:dbl], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:flt, X_1:bat[:flt], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:int, X_1:bat[:int], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:lng, X_1:bat[:lng], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariance(X_0:sht, X_1:bat[:sht], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance sample value of groups";

PATTERN batsql.covariancep(X_0:bat[:bte], X_1:bat[:bte], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:bte], X_1:bte, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:dbl], X_1:bat[:dbl], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:dbl], X_1:dbl, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:flt], X_1:bat[:flt], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:flt], X_1:flt, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:int], X_1:bat[:int], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:int], X_1:int, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:lng], X_1:bat[:lng], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:lng], X_1:lng, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:sht], X_1:bat[:sht], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bat[:sht], X_1:sht, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:bte, X_1:bat[:bte], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:dbl, X_1:bat[:dbl], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:flt, X_1:bat[:flt], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:int, X_1:bat[:int], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:lng, X_1:bat[:lng], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.covariancep(X_0:sht, X_1:bat[:sht], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:dbl];
COMMENT "return the covariance population value of groups";

PATTERN batsql.cume_dist(X_0:bat[:any_1], X_1:any_2, X_2:any_3):bat[:dbl];
COMMENT "return the accumulated distribution of the number of rows per group to the total number of partition rows";

PATTERN batsql.dense_rank(X_0:bat[:any_1], X_1:any_2, X_2:any_3):bat[:int];
COMMENT "return the densely ranked groups";

PATTERN batsql.diff(X_0:bat[:any_1]):bat[:bit];
COMMENT "return true if cur != prev row";

PATTERN batsql.diff(X_0:bat[:bit], X_1:any_1):bat[:bit];
COMMENT "return true if cur != prev row";

PATTERN batsql.diff(X_0:bat[:bit], X_1:bat[:any_1]):bat[:bit];
COMMENT "return true if cur != prev row";

PATTERN batsql.diff(X_0:bit, X_1:bat[:any_1]):bat[:bit];
COMMENT "return true if cur != prev row";

PATTERN batsql.first_value(X_0:bat[:any_1], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:any_1];
COMMENT "return the first value of groups";

PATTERN batsql.get_value(X_0:bat[:str], X_1:bat[:str]):bat[:lng];
COMMENT "return the current value of the sequence (ie the next to be used value)";

PATTERN batsql.get_value(X_0:bat[:str], X_1:bat[:str], X_2:bat[:oid], X_3:bat[:oid]):bat[:lng];
COMMENT "return the current value of the sequence (ie the next to be used value)";

PATTERN batsql.lag(X_0:any_1, X_1:any, X_2:bat[:any_1], X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lag(X_0:any_1, X_1:bat[:any], X_2:any_1, X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lag(X_0:any_1, X_1:bat[:any], X_2:any_2, X_3:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or NULL if non existent";

PATTERN batsql.lag(X_0:any_1, X_1:bat[:any], X_2:bat[:any_1], X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lag(X_0:bat[:any_1], X_1:any, X_2:any_1, X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lag(X_0:bat[:any_1], X_1:any, X_2:any_2, X_3:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or NULL if non existent";

PATTERN batsql.lag(X_0:bat[:any_1], X_1:any, X_2:bat[:any_1], X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lag(X_0:bat[:any_1], X_1:any_2, X_2:any_3):bat[:any_1];
COMMENT "return the value in the previous row in the partition or NULL if non existent";

PATTERN batsql.lag(X_0:bat[:any_1], X_1:bat[:any], X_2:any_1, X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lag(X_0:bat[:any_1], X_1:bat[:any], X_2:any_2, X_3:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or NULL if non existent";

PATTERN batsql.lag(X_0:bat[:any_1], X_1:bat[:any], X_2:bat[:any_1], X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the previous 'l' row in the partition or 'd' if non existent";

PATTERN batsql.last_value(X_0:bat[:any_1], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:any_1];
COMMENT "return the last value of groups";

PATTERN batsql.lead(X_0:any_1, X_1:any, X_2:bat[:any_1], X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lead(X_0:any_1, X_1:bat[:any], X_2:any_1, X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lead(X_0:any_1, X_1:bat[:any], X_2:any_2, X_3:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or NULL if non existent";

PATTERN batsql.lead(X_0:any_1, X_1:bat[:any], X_2:bat[:any_1], X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lead(X_0:bat[:any_1], X_1:any, X_2:any_1, X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lead(X_0:bat[:any_1], X_1:any, X_2:any_2, X_3:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or NULL if non existent";

PATTERN batsql.lead(X_0:bat[:any_1], X_1:any, X_2:bat[:any_1], X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lead(X_0:bat[:any_1], X_1:any_2, X_2:any_3):bat[:any_1];
COMMENT "return the value in the next row in the partition or NULL if non existent";

PATTERN batsql.lead(X_0:bat[:any_1], X_1:bat[:any], X_2:any_1, X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or 'd' if non existent";

PATTERN batsql.lead(X_0:bat[:any_1], X_1:bat[:any], X_2:any_2, X_3:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or NULL if non existent";

PATTERN batsql.lead(X_0:bat[:any_1], X_1:bat[:any], X_2:bat[:any_1], X_3:any_2, X_4:any_3):bat[:any_1];
COMMENT "return the value in the next 'l' row in the partition or 'd' if non existent";

PATTERN batsql.max(X_0:bat[:any_1], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:any_1];
COMMENT "return the maximum of groups";

PATTERN batsql.min(X_0:bat[:any_1], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:any_1];
COMMENT "return the minimum of groups";

UNSAFE PATTERN batsql.next_value(X_0:lng, X_1:str, X_2:str):bat[:lng];
COMMENT "return the next value of the sequence";

PATTERN batsql.nth_value(X_0:any_1, X_1:bat[:lng], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:any_1];
COMMENT "return the nth value of each group";

PATTERN batsql.nth_value(X_0:bat[:any_1], X_1:bat[:lng], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:any_1];
COMMENT "return the nth value of each group";

PATTERN batsql.nth_value(X_0:bat[:any_1], X_1:lng, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:any_1];
COMMENT "return the nth value of each group";

PATTERN batsql.ntile(X_0:any, X_1:bat[:any_1], X_2:any_2, X_3:any_3):bat[:any_1];
COMMENT "return the groups divided as equally as possible";

PATTERN batsql.ntile(X_0:bat[:any], X_1:any_1, X_2:any_2, X_3:any_3):bat[:any_1];
COMMENT "return the groups divided as equally as possible";

PATTERN batsql.ntile(X_0:bat[:any], X_1:bat[:any_1], X_2:any_2, X_3:any_3):bat[:any_1];
COMMENT "return the groups divided as equally as possible";

PATTERN batsql.percent_rank(X_0:bat[:any_1], X_1:any_2, X_2:any_3):bat[:dbl];
COMMENT "return the percentage into the total number of groups for each row";

PATTERN batsql.prod(X_0:bat[:bte], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:lng];
COMMENT "return the product of groups";

PATTERN batsql.prod(X_0:bat[:dbl], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the product of groups";

PATTERN batsql.prod(X_0:bat[:flt], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the product of groups";

PATTERN batsql.prod(X_0:bat[:flt], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:flt];
COMMENT "return the product of groups";

PATTERN batsql.prod(X_0:bat[:int], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:lng];
COMMENT "return the product of groups";

PATTERN batsql.prod(X_0:bat[:lng], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:lng];
COMMENT "return the product of groups";

PATTERN batsql.prod(X_0:bat[:sht], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:lng];
COMMENT "return the product of groups";

PATTERN batsql.rank(X_0:bat[:any_1], X_1:any_2, X_2:any_3):bat[:int];
COMMENT "return the ranked groups";

PATTERN batsql.row_number(X_0:bat[:any_1], X_1:any_2, X_2:any_3):bat[:int];
COMMENT "return the row_numer-ed groups";

PATTERN batsql.stdev(X_0:bat[:bte], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation sample of groups";

PATTERN batsql.stdev(X_0:bat[:dbl], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation sample of groups";

PATTERN batsql.stdev(X_0:bat[:flt], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation sample of groups";

PATTERN batsql.stdev(X_0:bat[:int], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation sample of groups";

PATTERN batsql.stdev(X_0:bat[:lng], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation sample of groups";

PATTERN batsql.stdev(X_0:bat[:sht], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation sample of groups";

PATTERN batsql.stdevp(X_0:bat[:bte], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation population of groups";

PATTERN batsql.stdevp(X_0:bat[:dbl], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation population of groups";

PATTERN batsql.stdevp(X_0:bat[:flt], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation population of groups";

PATTERN batsql.stdevp(X_0:bat[:int], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation population of groups";

PATTERN batsql.stdevp(X_0:bat[:lng], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation population of groups";

PATTERN batsql.stdevp(X_0:bat[:sht], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the standard deviation population of groups";

PATTERN batsql.str_group_concat(X_0:bat[:str], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:str];
COMMENT "return the string concatenation of groups";

PATTERN batsql.str_group_concat(X_0:bat[:str], X_1:bat[:str], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:str];
COMMENT "return the string concatenation of groups with a custom separator";

PATTERN batsql.str_group_concat(X_0:bat[:str], X_1:str, X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:str];
COMMENT "return the string concatenation of groups with a custom separator";

PATTERN batsql.str_group_concat(X_0:str, X_1:bat[:str], X_2:any, X_3:any, X_4:int, X_5:any, X_6:any):bat[:str];
COMMENT "return the string concatenation of groups with a custom separator";

PATTERN batsql.sum(X_0:bat[:bte], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:lng];
COMMENT "return the sum of groups";

PATTERN batsql.sum(X_0:bat[:dbl], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the sum of groups";

PATTERN batsql.sum(X_0:bat[:flt], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the sum of groups";

PATTERN batsql.sum(X_0:bat[:flt], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:flt];
COMMENT "return the sum of groups";

PATTERN batsql.sum(X_0:bat[:int], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:int];
COMMENT "return the sum of groups";

PATTERN batsql.sum(X_0:bat[:int], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:lng];
COMMENT "return the sum of groups";

PATTERN batsql.sum(X_0:bat[:lng], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:lng];
COMMENT "return the sum of groups";

PATTERN batsql.sum(X_0:bat[:sht], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:lng];
COMMENT "return the sum of groups";

PATTERN batsql.variance(X_0:bat[:bte], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance sample of groups";

PATTERN batsql.variance(X_0:bat[:dbl], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance sample of groups";

PATTERN batsql.variance(X_0:bat[:flt], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance sample of groups";

PATTERN batsql.variance(X_0:bat[:int], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance sample of groups";

PATTERN batsql.variance(X_0:bat[:lng], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance sample of groups";

PATTERN batsql.variance(X_0:bat[:sht], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance sample of groups";

PATTERN batsql.variancep(X_0:bat[:bte], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance population of groups";

PATTERN batsql.variancep(X_0:bat[:dbl], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance population of groups";

PATTERN batsql.variancep(X_0:bat[:flt], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance population of groups";

PATTERN batsql.variancep(X_0:bat[:int], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance population of groups";

PATTERN batsql.variancep(X_0:bat[:lng], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance population of groups";

PATTERN batsql.variancep(X_0:bat[:sht], X_1:any, X_2:any, X_3:int, X_4:any, X_5:any):bat[:dbl];
COMMENT "return the variance population of groups";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:bat[:bte]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:bat[:dbl]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:bat[:flt]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:bat[:int]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:bat[:lng]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:bat[:sht]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:bte):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:dbl):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:flt):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:int):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:lng):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:any_1], X_1:int, X_2:int, X_3:int, X_4:sht):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:bat[:bte]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:bat[:dbl]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:bat[:flt]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:bat[:int]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:bat[:lng]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:bat[:sht]):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:bte):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:dbl):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:flt):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:int):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:lng):bat[:oid];
COMMENT "computes window ranges for each row";

PATTERN batsql.window_bound(X_0:bat[:bit], X_1:bat[:any_1], X_2:int, X_3:int, X_4:int, X_5:sht):bat[:oid];
COMMENT "computes window ranges for each row";