@malloydata/malloy 0.0.355 → 0.0.357
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/lang/ast/field-space/rename-space-field.js +10 -0
- package/dist/lang/ast/statements/import-statement.js +7 -4
- package/dist/lang/composite-source-utils.js +22 -11
- package/dist/model/query_query.js +0 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
|
@@ -33,6 +33,7 @@ class RenameSpaceField extends space_field_1.SpaceField {
|
|
|
33
33
|
this.note = note;
|
|
34
34
|
}
|
|
35
35
|
fieldDef() {
|
|
36
|
+
var _a;
|
|
36
37
|
const returnFieldDef = this.otherField.fieldDef();
|
|
37
38
|
if (returnFieldDef === undefined) {
|
|
38
39
|
return undefined;
|
|
@@ -52,6 +53,15 @@ class RenameSpaceField extends space_field_1.SpaceField {
|
|
|
52
53
|
...returnFieldDef,
|
|
53
54
|
as: this.newName,
|
|
54
55
|
location: this.location,
|
|
56
|
+
fieldUsage: (_a = returnFieldDef.fieldUsage) === null || _a === void 0 ? void 0 : _a.map(u => {
|
|
57
|
+
var _a;
|
|
58
|
+
return ({
|
|
59
|
+
...u,
|
|
60
|
+
path: u.path[0] === ((_a = returnFieldDef.as) !== null && _a !== void 0 ? _a : returnFieldDef.name)
|
|
61
|
+
? [this.newName, ...u.path.slice(1)]
|
|
62
|
+
: u.path,
|
|
63
|
+
});
|
|
64
|
+
}),
|
|
55
65
|
};
|
|
56
66
|
}
|
|
57
67
|
typeDesc() {
|
|
@@ -109,14 +109,17 @@ class ImportStatement extends malloy_element_1.ListOf {
|
|
|
109
109
|
importOne.logError('name-conflict-on-selective-import', `Cannot redefine '${dstName}'`);
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
|
-
explicitImport[srcName]
|
|
112
|
+
if (explicitImport[srcName] === undefined) {
|
|
113
|
+
explicitImport[srcName] = [];
|
|
114
|
+
}
|
|
115
|
+
explicitImport[srcName].push(dstName);
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
const neededSourceIDs = new Set();
|
|
116
119
|
for (const srcName of importedModel.exports) {
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
+
const pickedNames = explicitImport[srcName];
|
|
121
|
+
const dstNames = pickedNames || (importAll ? [srcName] : []);
|
|
122
|
+
for (const dstName of dstNames) {
|
|
120
123
|
const importMe = {
|
|
121
124
|
...(0, malloy_types_1.safeRecordGet)(importedModel.contents, srcName),
|
|
122
125
|
};
|
|
@@ -335,16 +335,34 @@ function findActiveJoins(dependencies) {
|
|
|
335
335
|
* - `activeJoins`: Topologically sorted list of joins needed to resolve these uses
|
|
336
336
|
*/
|
|
337
337
|
function expandFieldUsage(fieldUsage, fields) {
|
|
338
|
-
var _a
|
|
338
|
+
var _a;
|
|
339
339
|
const seen = {};
|
|
340
340
|
const missingFields = [];
|
|
341
341
|
const toProcess = [];
|
|
342
342
|
const activeJoinGraph = {};
|
|
343
343
|
const ungroupings = [];
|
|
344
|
+
function mergeIntoSeen(usage) {
|
|
345
|
+
var _a;
|
|
346
|
+
const key = (0, utils_2.pathToKey)('field', usage.path);
|
|
347
|
+
if (!seen[key]) {
|
|
348
|
+
seen[key] = { ...usage };
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
const existing = seen[key];
|
|
352
|
+
if (usage.uniqueKeyRequirement) {
|
|
353
|
+
existing.uniqueKeyRequirement = {
|
|
354
|
+
isCount: ((_a = existing.uniqueKeyRequirement) === null || _a === void 0 ? void 0 : _a.isCount) ||
|
|
355
|
+
usage.uniqueKeyRequirement.isCount,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
if (usage.analyticFunctionUse) {
|
|
359
|
+
existing.analyticFunctionUse = true;
|
|
360
|
+
}
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
344
363
|
// Initialize: mark original inputs and add them to processing queue
|
|
345
364
|
for (const usage of fieldUsage) {
|
|
346
|
-
|
|
347
|
-
seen[seenKey] = usage;
|
|
365
|
+
mergeIntoSeen(usage);
|
|
348
366
|
toProcess.push(usage);
|
|
349
367
|
}
|
|
350
368
|
// Process the expanding queue
|
|
@@ -363,16 +381,9 @@ function expandFieldUsage(fieldUsage, fields) {
|
|
|
363
381
|
// Add the atomic field's dependencies to the queue
|
|
364
382
|
const refPath = reference.path.slice(0, -1);
|
|
365
383
|
for (const usage of joinedFieldUsage(refPath, fieldUsage)) {
|
|
366
|
-
|
|
367
|
-
if (!seen[key]) {
|
|
368
|
-
seen[key] = usage;
|
|
384
|
+
if (mergeIntoSeen(usage)) {
|
|
369
385
|
toProcess.push(usage);
|
|
370
386
|
}
|
|
371
|
-
else if (usage.uniqueKeyRequirement) {
|
|
372
|
-
seen[key].uniqueKeyRequirement = {
|
|
373
|
-
isCount: (_b = usage.uniqueKeyRequirement.isCount) !== null && _b !== void 0 ? _b : (_c = seen[key].uniqueKeyRequirement) === null || _c === void 0 ? void 0 : _c.isCount,
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
387
|
}
|
|
377
388
|
if (def.ungroupings) {
|
|
378
389
|
ungroupings.push(...joinedUngroupings(refPath, def.ungroupings));
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MALLOY_VERSION = "0.0.
|
|
1
|
+
export declare const MALLOY_VERSION = "0.0.357";
|
package/dist/version.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MALLOY_VERSION = void 0;
|
|
4
4
|
// generated with 'generate-version-file' script; do not edit manually
|
|
5
|
-
exports.MALLOY_VERSION = '0.0.
|
|
5
|
+
exports.MALLOY_VERSION = '0.0.357';
|
|
6
6
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/malloy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.357",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"generate-version-file": "VERSION=$(npm pkg get version --workspaces=false | tr -d \\\")\necho \"// generated with 'generate-version-file' script; do not edit manually\\nexport const MALLOY_VERSION = '$VERSION';\" > src/version.ts"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@malloydata/malloy-filter": "0.0.
|
|
51
|
-
"@malloydata/malloy-interfaces": "0.0.
|
|
52
|
-
"@malloydata/malloy-tag": "0.0.
|
|
50
|
+
"@malloydata/malloy-filter": "0.0.357",
|
|
51
|
+
"@malloydata/malloy-interfaces": "0.0.357",
|
|
52
|
+
"@malloydata/malloy-tag": "0.0.357",
|
|
53
53
|
"@noble/hashes": "^1.8.0",
|
|
54
54
|
"antlr4ts": "^0.5.0-alpha.4",
|
|
55
55
|
"assert": "^2.0.0",
|