alasql 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alasql-worker.js +2 -2
- package/dist/alasql-worker.min.js +1 -1
- package/dist/alasql.fs.js +93 -9
- package/dist/alasql.js +93 -9
- package/dist/alasql.min.js +38 -6
- package/package.json +3 -8
package/dist/alasql-worker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v2.2.
|
|
1
|
+
//! AlaSQL v2.2.1-develop-86ee0810 | © 2014-2022 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 2.2.
|
|
4
|
+
@version 2.2.1-develop-86ee0810
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2016 Andrey Gershun & Mathias Rangel Wulff
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
//! AlaSQL v2.2.
|
|
1
|
+
//! AlaSQL v2.2.1-develop-86ee0810 | © 2014-2022 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
!function(r,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():r.alasql=e()}(this,function(){function i(r,e,o){"function"==typeof(e=e||[])&&(scope=o,o=e,e=[]),"object"!=typeof e&&(e=[e]);var t=i.lastid++;i.buffer[t]=o,i.webworker.postMessage({id:t,sql:r,params:e})}var a;if(i.options={},i.options.progress=function(){},isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)},i.promise=function(){throw new Error("Please include a Promise/A+ library")},"undefined"!=typeof Promise&&(a=function(r,e,n,s){return new Promise(function(o,t){i(r,e,function(r,e){e?t(e):(n&&s&&!1!==i.options.progress&&i.options.progress(n,s),o(r))})})},i.promise=function(r,e){if("undefined"==typeof Promise)throw new Error("Please include a Promise/A+ library");if("string"==typeof r)return a(r,e);if(!isArray(r)||r.length<1||void 0!==e)throw new Error("Error in .promise parameters");var o=r;if(!(o.length<1)){for(var t,n,s=[],i=0;i<o.length;i++){if("string"==typeof(n=o[i])&&(n=[n]),!isArray(n)||n.length<1||2<n.length)throw new Error("Error in .promise parameter");t=n[0],n=n[1]||void 0,s.push(a(t,n,i,o.length))}return Promise.all(s)}}),i=i||!1)return i.worker=function(){throw new Error("Can find webworker in this enviroment")},"undefined"!=typeof Worker&&(i.worker=function(r,e,o){if(void 0===(r=!0===r?void 0:r))for(var t=document.getElementsByTagName("script"),n=0;n<t.length;n++){if("alasql-worker.js"===t[n].src.substr(-16).toLowerCase()){r=t[n].src.substr(0,t[n].src.length-16)+"alasql.js";break}if("alasql-worker.min.js"===t[n].src.substr(-20).toLowerCase()){r=t[n].src.substr(0,t[n].src.length-20)+"alasql.min.js";break}if("alasql.js"===t[n].src.substr(-9).toLowerCase()){r=t[n].src;break}if("alasql.min.js"===t[n].src.substr(-13).toLowerCase()){r=t[n].src.substr(0,t[n].src.length-13)+"alasql.min.js";break}}if(void 0===r)throw new Error("Path to alasql.js is not specified");var s;!1!==r?(s=(s="importScripts('")+r+"');self.onmessage = function(event) {alasql(event.data.sql,event.data.params, function(data){postMessage({id:event.data.id, data:data});});}",s=new Blob([s],{type:"text/plain"}),i.webworker=new Worker(URL.createObjectURL(s)),i.webworker.onmessage=function(r){var e=r.data.id;i.buffer[e](r.data.data),delete i.buffer[e]},i.webworker.onerror=function(r){throw r},1<arguments.length&&i("REQUIRE "+e.map(function(r){return'"'+r+'"'}).join(","),[],o)):!1===r&&delete i.webworker}),i.lastid=0,i.buffer={},i.worker(),i;throw new Error("alasql was not found")});
|
package/dist/alasql.fs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v2.2.
|
|
1
|
+
//! AlaSQL v2.2.1-develop-86ee0810 | © 2014-2022 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 2.2.
|
|
4
|
+
@version 2.2.1-develop-86ee0810
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2016 Andrey Gershun & Mathias Rangel Wulff
|
|
@@ -142,7 +142,7 @@ var alasql = function(sql, params, cb, scope) {
|
|
|
142
142
|
Current version of alasql
|
|
143
143
|
@constant {string}
|
|
144
144
|
*/
|
|
145
|
-
alasql.version = '2.2.
|
|
145
|
+
alasql.version = '2.2.1-develop-86ee0810';
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
Debug flag
|
|
@@ -8717,16 +8717,37 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8717
8717
|
",g['$$_VALUES_" + colas + "']={},g['$$_VALUES_" + colas + "'][" + colexp + ']=true';
|
|
8718
8718
|
}
|
|
8719
8719
|
if (col.aggregatorid === 'SUM') {
|
|
8720
|
-
|
|
8720
|
+
if ('funcid' in col.expression) {
|
|
8721
|
+
let colexpression = col.expression.args[0];
|
|
8722
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8723
|
+
return `'${colas}':(${colexp1})|| typeof ${colexp1} == 'number' ? ${colexp1} : null,`;
|
|
8724
|
+
}
|
|
8725
|
+
return `'${colas}':(${colexp})|| typeof ${colexp} == 'number' ? ${colexp} : null,`;
|
|
8721
8726
|
} else if (
|
|
8722
|
-
col.aggregatorid === 'MIN' ||
|
|
8723
|
-
col.aggregatorid === 'MAX' ||
|
|
8724
8727
|
col.aggregatorid === 'FIRST' ||
|
|
8725
8728
|
col.aggregatorid === 'LAST'
|
|
8726
8729
|
// || col.aggregatorid == 'AVG'
|
|
8727
8730
|
// ) { return "'"+col.as+'\':r[\''+col.as+'\'],'; }//f.field.arguments[0].toJS();
|
|
8728
8731
|
) {
|
|
8729
8732
|
return "'" + colas + "':" + colexp + ','; //f.field.arguments[0].toJS();
|
|
8733
|
+
} else if (col.aggregatorid === 'MIN') {
|
|
8734
|
+
if ('funcid' in col.expression) {
|
|
8735
|
+
let colexpression = col.expression.args[0];
|
|
8736
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8737
|
+
return `'${colas}': (typeof ${colexp1} == 'number' ? ${colexp1} : typeof ${colexp1} == 'object' ?
|
|
8738
|
+
typeof Number(${colexp1}) == 'number' && ${colexp1}!== null? ${colexp1} : null : null),`;
|
|
8739
|
+
}
|
|
8740
|
+
return `'${colas}': (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8741
|
+
typeof Number(${colexp}) == 'number' && ${colexp}!== null? ${colexp} : null : null),`;
|
|
8742
|
+
} else if (col.aggregatorid === 'MAX') {
|
|
8743
|
+
if ('funcid' in col.expression) {
|
|
8744
|
+
let colexpression = col.expression.args[0];
|
|
8745
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8746
|
+
return `'${colas}' : (typeof ${colexp1} == 'number' ? ${colexp1} : typeof ${colexp1} == 'object' ?
|
|
8747
|
+
typeof Number(${colexp1}) == 'number' ? ${colexp1} : null : null),`;
|
|
8748
|
+
}
|
|
8749
|
+
return `'${colas}' : (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8750
|
+
typeof Number(${colexp}) == 'number' ? ${colexp} : null : null),`;
|
|
8730
8751
|
} else if (col.aggregatorid === 'ARRAY') {
|
|
8731
8752
|
return "'" + colas + "':[" + colexp + '],';
|
|
8732
8753
|
} else if (col.aggregatorid === 'COUNT') {
|
|
@@ -8820,7 +8841,34 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8820
8841
|
var post = "g['$$_VALUES_" + colas + "'][" + colexp + ']=true;}';
|
|
8821
8842
|
}
|
|
8822
8843
|
if (col.aggregatorid === 'SUM') {
|
|
8823
|
-
|
|
8844
|
+
if ('funcid' in col.expression) {
|
|
8845
|
+
let colexpression = col.expression.args[0];
|
|
8846
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8847
|
+
return (
|
|
8848
|
+
pre +
|
|
8849
|
+
`if(g['${colas}'] == null && ${colexp1} == null){g['${colas}'] = null}
|
|
8850
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1}!== 'object' && typeof ${colexp1}!== 'number'){g['${colas}'] = null}
|
|
8851
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1} == 'number'){g['${colas}'] = ${colexp1}}
|
|
8852
|
+
else if(typeof g['${colas}']!== 'number' && typeof ${colexp1}!== 'number' && typeof ${colexp1}!== 'object'){g['${colas}'] = g['${colas}']}
|
|
8853
|
+
else if((g['${colas}'] == null || (typeof g['${colas}']!== 'number' && typeof g['${colas}']!== 'object')) && (${colexp1} == null || (typeof ${colexp1}!== 'number' && typeof ${colexp1}!== 'object'))){g['${colas}'] = null}
|
|
8854
|
+
else if(typeof g['${colas}'] == 'number' && typeof ${colexp1} ==null){g['${colas}'] = g['${colas}']}
|
|
8855
|
+
else if(typeof g['${colas}'] == null && typeof ${colexp1} =='number'){g['${colas}'] = ${colexp1}}
|
|
8856
|
+
else{g['${colas}'] += ${colexp1}||0}` +
|
|
8857
|
+
post
|
|
8858
|
+
);
|
|
8859
|
+
}
|
|
8860
|
+
return (
|
|
8861
|
+
pre +
|
|
8862
|
+
`if(g['${colas}'] == null && ${colexp} == null){g['${colas}'] = null}
|
|
8863
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number'&& typeof ${colexp}!== 'object' && typeof ${colexp}!== 'number'){g['${colas}'] = null}
|
|
8864
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp} == 'number'){g['${colas}'] = ${colexp}}
|
|
8865
|
+
else if(typeof g['${colas}']!== 'number' && typeof ${colexp}!== 'number' && typeof ${colexp}!== 'object'){g['${colas}'] = g['${colas}']}
|
|
8866
|
+
else if((g['${colas}'] == null || (typeof g['${colas}']!== 'number' && typeof g['${colas}']!== 'object')) && (${colexp} == null || (typeof ${colexp}!== 'number' && typeof ${colexp}!== 'object'))){g['${colas}'] = null}
|
|
8867
|
+
else if(typeof g['${colas}'] == 'number' && typeof ${colexp} ==null){g['${colas}'] = g['${colas}']}
|
|
8868
|
+
else if(typeof g['${colas}'] == null && typeof ${colexp} =='number'){g['${colas}'] = ${colexp}}
|
|
8869
|
+
else{g['${colas}'] += ${colexp}||0}` +
|
|
8870
|
+
post
|
|
8871
|
+
);
|
|
8824
8872
|
} else if (col.aggregatorid === 'COUNT') {
|
|
8825
8873
|
|
|
8826
8874
|
if (col.expression.columnid === '*') {
|
|
@@ -8841,12 +8889,48 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8841
8889
|
} else if (col.aggregatorid === 'ARRAY') {
|
|
8842
8890
|
return pre + "g['" + colas + "'].push(" + colexp + ');' + post;
|
|
8843
8891
|
} else if (col.aggregatorid === 'MIN') {
|
|
8892
|
+
if ('funcid' in col.expression) {
|
|
8893
|
+
let colexpression = col.expression.args[0];
|
|
8894
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8895
|
+
return (
|
|
8896
|
+
pre +
|
|
8897
|
+
`if((g['${colas}'] == null && ${colexp1}!== null) ? y = ${colexp1} : (g['${colas}']!== null &&
|
|
8898
|
+
${colexp1} == null) ? y = g['${colas}']:((y=${colexp1}) < g['${colas}'])){ if(typeof y == 'number')
|
|
8899
|
+
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8900
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8901
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8902
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8903
|
+
post
|
|
8904
|
+
);
|
|
8905
|
+
}
|
|
8844
8906
|
return (
|
|
8845
|
-
pre +
|
|
8907
|
+
pre +
|
|
8908
|
+
`if((g['${colas}'] == null && ${colexp}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8909
|
+
${colexp} == null) ? y = g['${colas}']:((y=${colexp}) < g['${colas}'])){ if(typeof y == 'number')
|
|
8910
|
+
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8911
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8912
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8913
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8914
|
+
post
|
|
8846
8915
|
);
|
|
8847
8916
|
} else if (col.aggregatorid === 'MAX') {
|
|
8917
|
+
if ('funcid' in col.expression) {
|
|
8918
|
+
let colexpression = col.expression.args[0];
|
|
8919
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8920
|
+
return (
|
|
8921
|
+
pre +
|
|
8922
|
+
`if((y=${colexp1}) > g['${colas}']){if(typeof y == 'number'){g['${colas}'] = y;}
|
|
8923
|
+
else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8924
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}` +
|
|
8925
|
+
post
|
|
8926
|
+
);
|
|
8927
|
+
}
|
|
8848
8928
|
return (
|
|
8849
|
-
pre +
|
|
8929
|
+
pre +
|
|
8930
|
+
`if((y=${colexp}) > g['${colas}']){if(typeof y == 'number'){g['${colas}'] = y;}
|
|
8931
|
+
else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8932
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}` +
|
|
8933
|
+
post
|
|
8850
8934
|
);
|
|
8851
8935
|
} else if (col.aggregatorid === 'FIRST') {
|
|
8852
8936
|
return '';
|
package/dist/alasql.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v2.2.
|
|
1
|
+
//! AlaSQL v2.2.1-develop-86ee0810 | © 2014-2022 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 2.2.
|
|
4
|
+
@version 2.2.1-develop-86ee0810
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2016 Andrey Gershun & Mathias Rangel Wulff
|
|
@@ -142,7 +142,7 @@ var alasql = function(sql, params, cb, scope) {
|
|
|
142
142
|
Current version of alasql
|
|
143
143
|
@constant {string}
|
|
144
144
|
*/
|
|
145
|
-
alasql.version = '2.2.
|
|
145
|
+
alasql.version = '2.2.1-develop-86ee0810';
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
Debug flag
|
|
@@ -8709,16 +8709,37 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8709
8709
|
",g['$$_VALUES_" + colas + "']={},g['$$_VALUES_" + colas + "'][" + colexp + ']=true';
|
|
8710
8710
|
}
|
|
8711
8711
|
if (col.aggregatorid === 'SUM') {
|
|
8712
|
-
|
|
8712
|
+
if ('funcid' in col.expression) {
|
|
8713
|
+
let colexpression = col.expression.args[0];
|
|
8714
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8715
|
+
return `'${colas}':(${colexp1})|| typeof ${colexp1} == 'number' ? ${colexp1} : null,`;
|
|
8716
|
+
}
|
|
8717
|
+
return `'${colas}':(${colexp})|| typeof ${colexp} == 'number' ? ${colexp} : null,`;
|
|
8713
8718
|
} else if (
|
|
8714
|
-
col.aggregatorid === 'MIN' ||
|
|
8715
|
-
col.aggregatorid === 'MAX' ||
|
|
8716
8719
|
col.aggregatorid === 'FIRST' ||
|
|
8717
8720
|
col.aggregatorid === 'LAST'
|
|
8718
8721
|
// || col.aggregatorid == 'AVG'
|
|
8719
8722
|
// ) { return "'"+col.as+'\':r[\''+col.as+'\'],'; }//f.field.arguments[0].toJS();
|
|
8720
8723
|
) {
|
|
8721
8724
|
return "'" + colas + "':" + colexp + ','; //f.field.arguments[0].toJS();
|
|
8725
|
+
} else if (col.aggregatorid === 'MIN') {
|
|
8726
|
+
if ('funcid' in col.expression) {
|
|
8727
|
+
let colexpression = col.expression.args[0];
|
|
8728
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8729
|
+
return `'${colas}': (typeof ${colexp1} == 'number' ? ${colexp1} : typeof ${colexp1} == 'object' ?
|
|
8730
|
+
typeof Number(${colexp1}) == 'number' && ${colexp1}!== null? ${colexp1} : null : null),`;
|
|
8731
|
+
}
|
|
8732
|
+
return `'${colas}': (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8733
|
+
typeof Number(${colexp}) == 'number' && ${colexp}!== null? ${colexp} : null : null),`;
|
|
8734
|
+
} else if (col.aggregatorid === 'MAX') {
|
|
8735
|
+
if ('funcid' in col.expression) {
|
|
8736
|
+
let colexpression = col.expression.args[0];
|
|
8737
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8738
|
+
return `'${colas}' : (typeof ${colexp1} == 'number' ? ${colexp1} : typeof ${colexp1} == 'object' ?
|
|
8739
|
+
typeof Number(${colexp1}) == 'number' ? ${colexp1} : null : null),`;
|
|
8740
|
+
}
|
|
8741
|
+
return `'${colas}' : (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8742
|
+
typeof Number(${colexp}) == 'number' ? ${colexp} : null : null),`;
|
|
8722
8743
|
} else if (col.aggregatorid === 'ARRAY') {
|
|
8723
8744
|
return "'" + colas + "':[" + colexp + '],';
|
|
8724
8745
|
} else if (col.aggregatorid === 'COUNT') {
|
|
@@ -8812,7 +8833,34 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8812
8833
|
var post = "g['$$_VALUES_" + colas + "'][" + colexp + ']=true;}';
|
|
8813
8834
|
}
|
|
8814
8835
|
if (col.aggregatorid === 'SUM') {
|
|
8815
|
-
|
|
8836
|
+
if ('funcid' in col.expression) {
|
|
8837
|
+
let colexpression = col.expression.args[0];
|
|
8838
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8839
|
+
return (
|
|
8840
|
+
pre +
|
|
8841
|
+
`if(g['${colas}'] == null && ${colexp1} == null){g['${colas}'] = null}
|
|
8842
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1}!== 'object' && typeof ${colexp1}!== 'number'){g['${colas}'] = null}
|
|
8843
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1} == 'number'){g['${colas}'] = ${colexp1}}
|
|
8844
|
+
else if(typeof g['${colas}']!== 'number' && typeof ${colexp1}!== 'number' && typeof ${colexp1}!== 'object'){g['${colas}'] = g['${colas}']}
|
|
8845
|
+
else if((g['${colas}'] == null || (typeof g['${colas}']!== 'number' && typeof g['${colas}']!== 'object')) && (${colexp1} == null || (typeof ${colexp1}!== 'number' && typeof ${colexp1}!== 'object'))){g['${colas}'] = null}
|
|
8846
|
+
else if(typeof g['${colas}'] == 'number' && typeof ${colexp1} ==null){g['${colas}'] = g['${colas}']}
|
|
8847
|
+
else if(typeof g['${colas}'] == null && typeof ${colexp1} =='number'){g['${colas}'] = ${colexp1}}
|
|
8848
|
+
else{g['${colas}'] += ${colexp1}||0}` +
|
|
8849
|
+
post
|
|
8850
|
+
);
|
|
8851
|
+
}
|
|
8852
|
+
return (
|
|
8853
|
+
pre +
|
|
8854
|
+
`if(g['${colas}'] == null && ${colexp} == null){g['${colas}'] = null}
|
|
8855
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number'&& typeof ${colexp}!== 'object' && typeof ${colexp}!== 'number'){g['${colas}'] = null}
|
|
8856
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp} == 'number'){g['${colas}'] = ${colexp}}
|
|
8857
|
+
else if(typeof g['${colas}']!== 'number' && typeof ${colexp}!== 'number' && typeof ${colexp}!== 'object'){g['${colas}'] = g['${colas}']}
|
|
8858
|
+
else if((g['${colas}'] == null || (typeof g['${colas}']!== 'number' && typeof g['${colas}']!== 'object')) && (${colexp} == null || (typeof ${colexp}!== 'number' && typeof ${colexp}!== 'object'))){g['${colas}'] = null}
|
|
8859
|
+
else if(typeof g['${colas}'] == 'number' && typeof ${colexp} ==null){g['${colas}'] = g['${colas}']}
|
|
8860
|
+
else if(typeof g['${colas}'] == null && typeof ${colexp} =='number'){g['${colas}'] = ${colexp}}
|
|
8861
|
+
else{g['${colas}'] += ${colexp}||0}` +
|
|
8862
|
+
post
|
|
8863
|
+
);
|
|
8816
8864
|
} else if (col.aggregatorid === 'COUNT') {
|
|
8817
8865
|
|
|
8818
8866
|
if (col.expression.columnid === '*') {
|
|
@@ -8833,12 +8881,48 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8833
8881
|
} else if (col.aggregatorid === 'ARRAY') {
|
|
8834
8882
|
return pre + "g['" + colas + "'].push(" + colexp + ');' + post;
|
|
8835
8883
|
} else if (col.aggregatorid === 'MIN') {
|
|
8884
|
+
if ('funcid' in col.expression) {
|
|
8885
|
+
let colexpression = col.expression.args[0];
|
|
8886
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8887
|
+
return (
|
|
8888
|
+
pre +
|
|
8889
|
+
`if((g['${colas}'] == null && ${colexp1}!== null) ? y = ${colexp1} : (g['${colas}']!== null &&
|
|
8890
|
+
${colexp1} == null) ? y = g['${colas}']:((y=${colexp1}) < g['${colas}'])){ if(typeof y == 'number')
|
|
8891
|
+
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8892
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8893
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8894
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8895
|
+
post
|
|
8896
|
+
);
|
|
8897
|
+
}
|
|
8836
8898
|
return (
|
|
8837
|
-
pre +
|
|
8899
|
+
pre +
|
|
8900
|
+
`if((g['${colas}'] == null && ${colexp}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8901
|
+
${colexp} == null) ? y = g['${colas}']:((y=${colexp}) < g['${colas}'])){ if(typeof y == 'number')
|
|
8902
|
+
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8903
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8904
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8905
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8906
|
+
post
|
|
8838
8907
|
);
|
|
8839
8908
|
} else if (col.aggregatorid === 'MAX') {
|
|
8909
|
+
if ('funcid' in col.expression) {
|
|
8910
|
+
let colexpression = col.expression.args[0];
|
|
8911
|
+
let colexp1 = colexpression.toJS('p', tableid, defcols);
|
|
8912
|
+
return (
|
|
8913
|
+
pre +
|
|
8914
|
+
`if((y=${colexp1}) > g['${colas}']){if(typeof y == 'number'){g['${colas}'] = y;}
|
|
8915
|
+
else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8916
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}` +
|
|
8917
|
+
post
|
|
8918
|
+
);
|
|
8919
|
+
}
|
|
8840
8920
|
return (
|
|
8841
|
-
pre +
|
|
8921
|
+
pre +
|
|
8922
|
+
`if((y=${colexp}) > g['${colas}']){if(typeof y == 'number'){g['${colas}'] = y;}
|
|
8923
|
+
else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8924
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}` +
|
|
8925
|
+
post
|
|
8842
8926
|
);
|
|
8843
8927
|
} else if (col.aggregatorid === 'FIRST') {
|
|
8844
8928
|
return '';
|