@devrev/meerkat-core 0.0.93 → 0.0.94
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.
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "equalsTransform", {
|
|
|
7
7
|
});
|
|
8
8
|
const _Expression = require("../../types/duckdb-serialization-types/serialization/Expression");
|
|
9
9
|
const _isarraymembertype = require("../../utils/is-array-member-type");
|
|
10
|
+
const _and = require("../and/and");
|
|
10
11
|
const _baseconditionbuilder = require("../base-condition-builder/base-condition-builder");
|
|
11
|
-
const _or = require("../or/or");
|
|
12
12
|
const _equalsarray = require("./equals-array");
|
|
13
13
|
const equalsTransform = (query)=>{
|
|
14
14
|
const { member, values } = query;
|
|
@@ -26,12 +26,12 @@ const equalsTransform = (query)=>{
|
|
|
26
26
|
return (0, _baseconditionbuilder.baseDuckdbCondition)(member, _Expression.ExpressionType.COMPARE_EQUAL, values[0], query.memberInfo);
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* If there are multiple values, we need to create an
|
|
30
|
-
*/ const
|
|
29
|
+
* If there are multiple values, we need to create an AND condition
|
|
30
|
+
*/ const andCondition = (0, _and.andDuckdbCondition)();
|
|
31
31
|
values.forEach((value)=>{
|
|
32
|
-
|
|
32
|
+
andCondition.children.push((0, _baseconditionbuilder.baseDuckdbCondition)(member, _Expression.ExpressionType.COMPARE_EQUAL, value, query.memberInfo));
|
|
33
33
|
});
|
|
34
|
-
return
|
|
34
|
+
return andCondition;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
//# sourceMappingURL=equals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../meerkat-core/src/cube-filter-transformer/equals/equals.ts"],"sourcesContent":["import { ExpressionType } from '../../types/duckdb-serialization-types/serialization/Expression';\nimport { isArrayTypeMember } from '../../utils/is-array-member-type';\nimport { baseDuckdbCondition } from '../base-condition-builder/base-condition-builder';\nimport { CubeToParseExpressionTransform } from '../factory';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../meerkat-core/src/cube-filter-transformer/equals/equals.ts"],"sourcesContent":["import { ExpressionType } from '../../types/duckdb-serialization-types/serialization/Expression';\nimport { isArrayTypeMember } from '../../utils/is-array-member-type';\nimport { andDuckdbCondition } from '../and/and';\nimport { baseDuckdbCondition } from '../base-condition-builder/base-condition-builder';\nimport { CubeToParseExpressionTransform } from '../factory';\nimport { equalsArrayTransform } from './equals-array';\n\nexport const equalsTransform: CubeToParseExpressionTransform = (query) => {\n const { member, values } = query;\n\n /**\n * If the member is an array, we need to use the array transform\n */\n if (isArrayTypeMember(query.memberInfo.type)) {\n return equalsArrayTransform(query);\n }\n\n if (!values || values.length === 0) {\n throw new Error('Equals filter must have at least one value');\n }\n\n /**\n * If there is only one value, we can create a simple equals condition\n */\n if (values.length === 1) {\n return baseDuckdbCondition(\n member,\n ExpressionType.COMPARE_EQUAL,\n values[0],\n query.memberInfo\n );\n }\n\n /**\n * If there are multiple values, we need to create an AND condition\n */\n const andCondition = andDuckdbCondition();\n values.forEach((value) => {\n andCondition.children.push(\n baseDuckdbCondition(\n member,\n ExpressionType.COMPARE_EQUAL,\n value,\n query.memberInfo\n )\n );\n });\n return andCondition;\n};\n"],"names":["equalsTransform","query","member","values","isArrayTypeMember","memberInfo","type","equalsArrayTransform","length","Error","baseDuckdbCondition","ExpressionType","COMPARE_EQUAL","andCondition","andDuckdbCondition","forEach","value","children","push"],"mappings":";+BAOaA;;;eAAAA;;;4BAPkB;mCACG;qBACC;sCACC;6BAEC;AAE9B,MAAMA,kBAAkD,CAACC;IAC9D,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAE,GAAGF;IAE3B;;GAEC,GACD,IAAIG,IAAAA,oCAAiB,EAACH,MAAMI,UAAU,CAACC,IAAI,GAAG;QAC5C,OAAOC,IAAAA,iCAAoB,EAACN;IAC9B;IAEA,IAAI,CAACE,UAAUA,OAAOK,MAAM,KAAK,GAAG;QAClC,MAAM,IAAIC,MAAM;IAClB;IAEA;;GAEC,GACD,IAAIN,OAAOK,MAAM,KAAK,GAAG;QACvB,OAAOE,IAAAA,yCAAmB,EACxBR,QACAS,0BAAc,CAACC,aAAa,EAC5BT,MAAM,CAAC,EAAE,EACTF,MAAMI,UAAU;IAEpB;IAEA;;GAEC,GACD,MAAMQ,eAAeC,IAAAA,uBAAkB;IACvCX,OAAOY,OAAO,CAAC,CAACC;QACdH,aAAaI,QAAQ,CAACC,IAAI,CACxBR,IAAAA,yCAAmB,EACjBR,QACAS,0BAAc,CAACC,aAAa,EAC5BI,OACAf,MAAMI,UAAU;IAGtB;IACA,OAAOQ;AACT"}
|