@malloydata/malloy 0.0.220-dev241205235613 → 0.0.220-dev241206021955

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.
@@ -58,7 +58,6 @@ export * from './expressions/expr-array-literal';
58
58
  export * from './expressions/expr-record-literal';
59
59
  export * from './expressions/range';
60
60
  export * from './expressions/time-frame';
61
- export * from './expressions/top-by';
62
61
  export * from './expressions/unary';
63
62
  export * from './statements/import-statement';
64
63
  export * from './query-properties/extend';
@@ -96,7 +96,6 @@ __exportStar(require("./expressions/expr-array-literal"), exports);
96
96
  __exportStar(require("./expressions/expr-record-literal"), exports);
97
97
  __exportStar(require("./expressions/range"), exports);
98
98
  __exportStar(require("./expressions/time-frame"), exports);
99
- __exportStar(require("./expressions/top-by"), exports);
100
99
  __exportStar(require("./expressions/unary"), exports);
101
100
  __exportStar(require("./statements/import-statement"), exports);
102
101
  __exportStar(require("./query-properties/extend"), exports);
@@ -474,17 +474,6 @@ export interface FunctionOrderByDefaultExpression extends ExprLeaf {
474
474
  dir: 'asc' | 'desc';
475
475
  }
476
476
  export type FunctionOrderBy = FunctionOrderByExpression | FunctionOrderByDefaultExpression;
477
- export interface ByName {
478
- by: 'name';
479
- name: string;
480
- }
481
- export interface ByExpression {
482
- by: 'expression';
483
- e: Expr;
484
- }
485
- export type By = ByName | ByExpression;
486
- export declare function isByName(by: By | undefined): by is ByName;
487
- export declare function isByExpression(by: By | undefined): by is ByExpression;
488
477
  /** reference to a data source */
489
478
  export type StructRef = string | SourceDef;
490
479
  export declare function refIsStructDef(ref: StructRef): ref is SourceDef;
@@ -22,8 +22,8 @@
22
22
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.sourceBase = exports.isSegmentSQL = exports.isIndexSegment = exports.isRawSegment = exports.isSamplingEnable = exports.isSamplingPercent = exports.isSamplingRows = exports.isQuerySegment = exports.isProjectSegment = exports.isPartialSegment = exports.isReduceSegment = exports.structHasErrors = exports.segmentHasErrors = exports.refIsStructDef = exports.isByExpression = exports.isByName = exports.ValueType = exports.isExtractUnit = exports.isTimestampUnit = exports.isDateUnit = exports.isJoinedSource = exports.isJoined = exports.isJoinable = exports.isMatrixOperation = exports.isScalarArray = exports.isRepeatedRecord = exports.mkArrayDef = exports.mkFieldDef = exports.fieldIsIntrinsic = exports.isCastType = exports.canOrderBy = exports.isAtomicFieldType = exports.isTemporalType = exports.hasExpression = exports.maxOfExpressionTypes = exports.maxExpressionType = exports.isExpressionTypeLEQ = exports.expressionIsAnalytic = exports.expressionIsCalculation = exports.expressionInvolvesAggregate = exports.expressionIsUngroupedAggregate = exports.expressionIsAggregate = exports.expressionIsScalar = exports.paramHasValue = exports.isRawCast = exports.mkTemporal = exports.isAsymmetricExpr = exports.exprIsLeaf = exports.exprHasE = exports.exprHasKids = void 0;
26
- exports.TD = exports.isValueDate = exports.isValueTimestamp = exports.isValueBoolean = exports.isValueNumber = exports.isValueString = exports.isAtomic = exports.isTurtle = exports.getIdentifier = exports.isLeafAtomic = exports.mergeEvalSpaces = exports.isLiteral = exports.isBaseTable = exports.isSourceDef = void 0;
25
+ exports.isBaseTable = exports.isSourceDef = exports.sourceBase = exports.isSegmentSQL = exports.isIndexSegment = exports.isRawSegment = exports.isSamplingEnable = exports.isSamplingPercent = exports.isSamplingRows = exports.isQuerySegment = exports.isProjectSegment = exports.isPartialSegment = exports.isReduceSegment = exports.structHasErrors = exports.segmentHasErrors = exports.refIsStructDef = exports.ValueType = exports.isExtractUnit = exports.isTimestampUnit = exports.isDateUnit = exports.isJoinedSource = exports.isJoined = exports.isJoinable = exports.isMatrixOperation = exports.isScalarArray = exports.isRepeatedRecord = exports.mkArrayDef = exports.mkFieldDef = exports.fieldIsIntrinsic = exports.isCastType = exports.canOrderBy = exports.isAtomicFieldType = exports.isTemporalType = exports.hasExpression = exports.maxOfExpressionTypes = exports.maxExpressionType = exports.isExpressionTypeLEQ = exports.expressionIsAnalytic = exports.expressionIsCalculation = exports.expressionInvolvesAggregate = exports.expressionIsUngroupedAggregate = exports.expressionIsAggregate = exports.expressionIsScalar = exports.paramHasValue = exports.isRawCast = exports.mkTemporal = exports.isAsymmetricExpr = exports.exprIsLeaf = exports.exprHasE = exports.exprHasKids = void 0;
26
+ exports.TD = exports.isValueDate = exports.isValueTimestamp = exports.isValueBoolean = exports.isValueNumber = exports.isValueString = exports.isAtomic = exports.isTurtle = exports.getIdentifier = exports.isLeafAtomic = exports.mergeEvalSpaces = exports.isLiteral = void 0;
27
27
  function exprHasKids(e) {
28
28
  return 'kids' in e;
29
29
  }
@@ -270,20 +270,6 @@ var ValueType;
270
270
  ValueType["Number"] = "number";
271
271
  ValueType["String"] = "string";
272
272
  })(ValueType || (exports.ValueType = ValueType = {}));
273
- function isByName(by) {
274
- if (by === undefined) {
275
- return false;
276
- }
277
- return by.by === 'name';
278
- }
279
- exports.isByName = isByName;
280
- function isByExpression(by) {
281
- if (by === undefined) {
282
- return false;
283
- }
284
- return by.by === 'name';
285
- }
286
- exports.isByExpression = isByExpression;
287
273
  function refIsStructDef(ref) {
288
274
  return typeof ref !== 'string';
289
275
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.220-dev241205235613",
3
+ "version": "0.0.220-dev241206021955",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -1,10 +0,0 @@
1
- import { By } from '../../../model/malloy_types';
2
- import { ExpressionDef } from '../types/expression-def';
3
- import { FieldSpace } from '../types/field-space';
4
- import { MalloyElement } from '../types/malloy-element';
5
- export declare class TopBy extends MalloyElement {
6
- readonly by: string | ExpressionDef;
7
- elementType: string;
8
- constructor(by: string | ExpressionDef);
9
- getBy(fs: FieldSpace): By;
10
- }
@@ -1,50 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright 2023 Google LLC
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining
6
- * a copy of this software and associated documentation files
7
- * (the "Software"), to deal in the Software without restriction,
8
- * including without limitation the rights to use, copy, modify, merge,
9
- * publish, distribute, sublicense, and/or sell copies of the Software,
10
- * and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be
14
- * included in all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
- */
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.TopBy = void 0;
26
- const malloy_types_1 = require("../../../model/malloy_types");
27
- const expression_def_1 = require("../types/expression-def");
28
- const malloy_element_1 = require("../types/malloy-element");
29
- class TopBy extends malloy_element_1.MalloyElement {
30
- constructor(by) {
31
- super();
32
- this.by = by;
33
- this.elementType = 'topBy';
34
- if (by instanceof expression_def_1.ExpressionDef) {
35
- this.has({ by: by });
36
- }
37
- }
38
- getBy(fs) {
39
- if (this.by instanceof expression_def_1.ExpressionDef) {
40
- const byExpr = this.by.getExpression(fs);
41
- if (!(0, malloy_types_1.expressionIsAggregate)(byExpr.expressionType)) {
42
- this.logError('top-by-non-aggregate', 'top by expression must be an aggregate');
43
- }
44
- return { by: 'expression', e: byExpr.value };
45
- }
46
- return { by: 'name', name: this.by };
47
- }
48
- }
49
- exports.TopBy = TopBy;
50
- //# sourceMappingURL=top-by.js.map