@malloydata/malloy 0.0.285 → 0.0.287
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/index.d.ts +1 -1
- package/dist/lang/ast/query-properties/drill.js +1 -0
- package/dist/lang/ast/query-properties/filters.js +2 -0
- package/dist/lang/ast/source-elements/refined-source.js +4 -1
- package/dist/lang/malloy-to-ast.js +0 -1
- package/dist/model/malloy_types.d.ts +1 -0
- package/dist/to_stable.js +9 -10
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DuckDBDialect, StandardSQLDialect, TrinoDialect, PostgresDialect, SnowflakeDialect, MySQLDialect, registerDialect, arg, qtz, overload, minScalar, anyExprType, minAggregate, maxScalar, sql, makeParam, param, variadicParam, literal, spread, Dialect, TinyParser, } from './dialect';
|
|
2
2
|
export type { DialectFieldList, DialectFunctionOverloadDef, QueryInfo, MalloyStandardFunctionImplementations, DefinitionBlueprint, DefinitionBlueprintMap, OverloadedDefinitionBlueprint, TinyToken, } from './dialect';
|
|
3
|
-
export type { QueryDataRow, StructDef, TableSourceDef, SQLSourceDef, SourceDef, JoinFieldDef, NamedSourceDefs, MalloyQueryData, DateUnit, ExtractUnit, TimestampUnit, TemporalFieldType, QueryData, QueryValue, Expr, FilterCondition, Argument, Parameter, FieldDef, PipeSegment, QueryFieldDef, IndexFieldDef, TurtleDef, SearchValueMapResult, SearchIndexResult, ModelDef, Query, QueryResult, QueryRunStats, NamedQuery, NamedModelObject, ExpressionType, FunctionDef, FunctionOverloadDef, FunctionParameterDef, ExpressionValueType, TypeDesc, FunctionParamTypeDesc, DocumentLocation, DocumentRange, DocumentPosition, Sampling, Annotation, BasicAtomicTypeDef, BasicAtomicDef, AtomicTypeDef, AtomicFieldDef, ArrayDef, ArrayTypeDef, RecordTypeDef, RepeatedRecordTypeDef, RecordDef, RepeatedRecordDef, RecordLiteralNode, StringLiteralNode, ArrayLiteralNode, } from './model';
|
|
3
|
+
export type { QueryDataRow, StructDef, TableSourceDef, SQLSourceDef, SourceDef, JoinFieldDef, NamedSourceDefs, MalloyQueryData, DateUnit, ExtractUnit, TimestampUnit, TemporalFieldType, QueryData, QueryValue, Expr, FilterCondition, Argument, Parameter, FieldDef, PipeSegment, QueryFieldDef, IndexFieldDef, TurtleDef, SearchValueMapResult, SearchIndexResult, ModelDef, Query, QueryResult, QueryResultDef, QueryRunStats, QueryScalar, NamedQuery, NamedModelObject, ExpressionType, FunctionDef, FunctionOverloadDef, FunctionParameterDef, ExpressionValueType, TypeDesc, FunctionParamTypeDesc, DocumentLocation, DocumentRange, DocumentPosition, Sampling, Annotation, BasicAtomicTypeDef, BasicAtomicDef, AtomicTypeDef, AtomicFieldDef, ArrayDef, ArrayTypeDef, RecordTypeDef, RepeatedRecordTypeDef, RecordDef, RepeatedRecordDef, RecordLiteralNode, StringLiteralNode, ArrayLiteralNode, } from './model';
|
|
4
4
|
export { isSourceDef, Segment, isBasicAtomic, isJoined, isJoinedSource, isSamplingEnable, isSamplingPercent, isSamplingRows, isRepeatedRecord, isBasicArray, mkArrayDef, mkFieldDef, expressionIsAggregate, expressionIsAnalytic, expressionIsCalculation, expressionIsScalar, expressionIsUngroupedAggregate, indent, composeSQLExpr, isTimestampUnit, isDateUnit, } from './model';
|
|
5
5
|
export { malloyToQuery, MalloyTranslator, } from './lang';
|
|
6
6
|
export type { LogMessage, TranslateResponse } from './lang';
|
|
@@ -75,6 +75,7 @@ class FilterElement extends malloy_element_1.MalloyElement {
|
|
|
75
75
|
e: { node: 'false' },
|
|
76
76
|
expressionType: 'scalar',
|
|
77
77
|
fieldUsage: exprVal.fieldUsage,
|
|
78
|
+
isSourceFilter: false,
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
81
|
const stableFilter = this.getStableFilter();
|
|
@@ -85,6 +86,7 @@ class FilterElement extends malloy_element_1.MalloyElement {
|
|
|
85
86
|
expressionType: exprVal.expressionType,
|
|
86
87
|
fieldUsage: exprVal.fieldUsage,
|
|
87
88
|
stableFilter,
|
|
89
|
+
isSourceFilter: false,
|
|
88
90
|
};
|
|
89
91
|
return exprCond;
|
|
90
92
|
}
|
|
@@ -147,7 +147,10 @@ class RefinedSource extends source_1.Source {
|
|
|
147
147
|
el.logError('aggregate-in-source-filter', "Can't use aggregate computations in top level filters");
|
|
148
148
|
}
|
|
149
149
|
else {
|
|
150
|
-
filterList.push(
|
|
150
|
+
filterList.push({
|
|
151
|
+
...fc,
|
|
152
|
+
isSourceFilter: true,
|
|
153
|
+
});
|
|
151
154
|
moreFilters = true;
|
|
152
155
|
}
|
|
153
156
|
}
|
|
@@ -530,7 +530,6 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
530
530
|
return new ast.Filter(pcx.fieldExpr().map(f => this.getFilterElement(f)));
|
|
531
531
|
}
|
|
532
532
|
visitDrillClauseList(pcx) {
|
|
533
|
-
this.inExperiment('drill', pcx);
|
|
534
533
|
return new ast.Drill(pcx.fieldExpr().map(f => this.getFilterElement(f)));
|
|
535
534
|
}
|
|
536
535
|
visitWhereStatement(pcx) {
|
package/dist/to_stable.js
CHANGED
|
@@ -206,7 +206,6 @@ function convertFieldInfos(source, fields) {
|
|
|
206
206
|
return result;
|
|
207
207
|
}
|
|
208
208
|
function getResultMetadataAnnotation(field, resultMetadata) {
|
|
209
|
-
var _a;
|
|
210
209
|
const tag = malloy_tag_1.Tag.withPrefix('#(malloy) ');
|
|
211
210
|
let hasAny = false;
|
|
212
211
|
if (resultMetadata.referenceId !== undefined) {
|
|
@@ -227,9 +226,8 @@ function getResultMetadataAnnotation(field, resultMetadata) {
|
|
|
227
226
|
hasAny = true;
|
|
228
227
|
}
|
|
229
228
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
addDrillFiltersTag(tag, drillFilters);
|
|
229
|
+
if (resultMetadata.filterList) {
|
|
230
|
+
addDrillFiltersTag(tag, resultMetadata.filterList);
|
|
233
231
|
hasAny = true;
|
|
234
232
|
}
|
|
235
233
|
if (resultMetadata.fieldKind === 'dimension') {
|
|
@@ -253,6 +251,8 @@ function addDrillFiltersTag(tag, drillFilters) {
|
|
|
253
251
|
var _a;
|
|
254
252
|
for (let i = 0; i < drillFilters.length; i++) {
|
|
255
253
|
const filter = drillFilters[i];
|
|
254
|
+
if (filter.expressionType !== 'scalar' || filter.isSourceFilter)
|
|
255
|
+
continue;
|
|
256
256
|
tag.set(['drill_filters', i, 'code'], filter.code);
|
|
257
257
|
if (filter.drillView) {
|
|
258
258
|
tag.set(['drill_filters', i, 'drill_view'], filter.drillView);
|
|
@@ -309,16 +309,15 @@ function identifierCode(name) {
|
|
|
309
309
|
return `\`${escapeIdentifier(name)}\``;
|
|
310
310
|
}
|
|
311
311
|
function getResultStructMetadataAnnotation(field, resultMetadata) {
|
|
312
|
-
var _a, _b
|
|
312
|
+
var _a, _b;
|
|
313
313
|
const tag = malloy_tag_1.Tag.withPrefix('#(malloy) ');
|
|
314
314
|
let hasAny = false;
|
|
315
315
|
if (resultMetadata.limit !== undefined) {
|
|
316
316
|
tag.set(['limit'], resultMetadata.limit);
|
|
317
317
|
hasAny = true;
|
|
318
318
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
addDrillFiltersTag(tag, drillFilters);
|
|
319
|
+
if (resultMetadata.filterList) {
|
|
320
|
+
addDrillFiltersTag(tag, resultMetadata.filterList);
|
|
322
321
|
hasAny = true;
|
|
323
322
|
}
|
|
324
323
|
if (resultMetadata.drillable) {
|
|
@@ -329,9 +328,9 @@ function getResultStructMetadataAnnotation(field, resultMetadata) {
|
|
|
329
328
|
for (let i = 0; i < resultMetadata.orderBy.length; i++) {
|
|
330
329
|
const orderBy = resultMetadata.orderBy[i];
|
|
331
330
|
const orderByField = typeof orderBy.field === 'number'
|
|
332
|
-
? (
|
|
331
|
+
? (_a = field.fields[orderBy.field - 1].as) !== null && _a !== void 0 ? _a : field.fields[orderBy.field - 1].name
|
|
333
332
|
: orderBy.field;
|
|
334
|
-
const direction = (
|
|
333
|
+
const direction = (_b = orderBy.dir) !== null && _b !== void 0 ? _b : null;
|
|
335
334
|
tag.set(['ordered_by', i, orderByField], direction);
|
|
336
335
|
}
|
|
337
336
|
hasAny = true;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MALLOY_VERSION = "0.0.
|
|
1
|
+
export declare const MALLOY_VERSION = "0.0.287";
|
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.287';
|
|
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.287",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"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"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@malloydata/malloy-filter": "0.0.
|
|
45
|
-
"@malloydata/malloy-interfaces": "0.0.
|
|
46
|
-
"@malloydata/malloy-tag": "0.0.
|
|
44
|
+
"@malloydata/malloy-filter": "0.0.287",
|
|
45
|
+
"@malloydata/malloy-interfaces": "0.0.287",
|
|
46
|
+
"@malloydata/malloy-tag": "0.0.287",
|
|
47
47
|
"antlr4ts": "^0.5.0-alpha.4",
|
|
48
48
|
"assert": "^2.0.0",
|
|
49
49
|
"jaro-winkler": "^0.2.8",
|