@devrev/meerkat-core 0.0.121 → 0.0.122
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/package.json
CHANGED
|
@@ -3,7 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.arrayUnnestModifier = exports.shouldUnnest = exports.arrayFieldUnNestModifier = void 0;
|
|
4
4
|
const is_array_member_type_1 = require("../../utils/is-array-member-type");
|
|
5
5
|
const arrayFieldUnNestModifier = ({ sqlExpression, }) => {
|
|
6
|
-
|
|
6
|
+
// Ensure NULL or empty arrays produce at least one row with NULL value
|
|
7
|
+
// This prevents rows from being dropped when arrays are NULL or empty
|
|
8
|
+
// COALESCE handles NULL, and len() = 0 check handles empty arrays []
|
|
9
|
+
// We use [NULL] to preserve the row, then use NULLIF to convert [NULL] back to NULL
|
|
10
|
+
return `NULLIF(array[unnest(CASE WHEN ${sqlExpression} IS NULL OR len(COALESCE(${sqlExpression}, [])) = 0 THEN [NULL] ELSE ${sqlExpression} END)], [NULL])`;
|
|
7
11
|
};
|
|
8
12
|
exports.arrayFieldUnNestModifier = arrayFieldUnNestModifier;
|
|
9
13
|
const shouldUnnest = ({ dimension, query, }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-unnest-modifier.js","sourceRoot":"","sources":["../../../../../meerkat-core/src/get-wrapped-base-query-with-projections/modifiers/array-unnest-modifier.ts"],"names":[],"mappings":";;;AAAA,2EAAqE;AAG9D,MAAM,wBAAwB,GAAG,CAAC,EACvC,aAAa,GACK,EAAU,EAAE;IAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"array-unnest-modifier.js","sourceRoot":"","sources":["../../../../../meerkat-core/src/get-wrapped-base-query-with-projections/modifiers/array-unnest-modifier.ts"],"names":[],"mappings":";;;AAAA,2EAAqE;AAG9D,MAAM,wBAAwB,GAAG,CAAC,EACvC,aAAa,GACK,EAAU,EAAE;IAC9B,uEAAuE;IACvE,sEAAsE;IACtE,qEAAqE;IACrE,oFAAoF;IACpF,OAAO,iCAAiC,aAAa,4BAA4B,aAAa,+BAA+B,aAAa,iBAAiB,CAAC;AAC9J,CAAC,CAAC;AARW,QAAA,wBAAwB,4BAQnC;AAEK,MAAM,YAAY,GAAG,CAAC,EAC3B,SAAS,EACT,KAAK,GACa,EAAW,EAAE;;IAC/B,MAAM,WAAW,GAAG,IAAA,wCAAiB,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACtD,MAAM,kBAAkB,GAAG,MAAA,SAAS,CAAC,QAAQ,0CAAE,mBAAmB,CAAC;IACnE,OAAO,CAAC,CAAC,CAAC,WAAW,IAAI,kBAAkB,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC;AAPW,QAAA,YAAY,gBAOvB;AAEW,QAAA,mBAAmB,GAAa;IAC3C,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,oBAAY;IACrB,QAAQ,EAAE,gCAAwB;CACnC,CAAC"}
|