@malloydata/malloy 0.0.110 → 0.0.111-dev231204165238

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.
@@ -30,11 +30,13 @@ export declare class KeyJoin extends Join {
30
30
  fixupJoinOn(outer: FieldSpace, inStruct: StructDef): void;
31
31
  }
32
32
  type ExpressionJoinType = 'many' | 'one' | 'cross';
33
+ export type MatrixOperation = 'left' | 'inner' | 'right' | 'full';
33
34
  export declare class ExpressionJoin extends Join {
34
35
  readonly name: ModelEntryReference;
35
36
  readonly sourceExpr: SourceQueryNode;
36
37
  elementType: string;
37
38
  joinType: ExpressionJoinType;
39
+ matrixOperation: MatrixOperation;
38
40
  private expr?;
39
41
  constructor(name: ModelEntryReference, sourceExpr: SourceQueryNode);
40
42
  set joinOn(joinExpr: ExpressionDef | undefined);
@@ -65,6 +65,7 @@ class KeyJoin extends Join {
65
65
  ...sourceDef,
66
66
  structRelationship: {
67
67
  type: 'one',
68
+ matrixOperation: 'left',
68
69
  onExpression: ["('join fixup'='not done yet')"],
69
70
  },
70
71
  location: this.location,
@@ -90,6 +91,7 @@ class KeyJoin extends Join {
90
91
  if (pkey.type === exprX.dataType) {
91
92
  inStruct.structRelationship = {
92
93
  type: 'one',
94
+ matrixOperation: 'left',
93
95
  onExpression: [
94
96
  {
95
97
  type: 'field',
@@ -122,6 +124,7 @@ class ExpressionJoin extends Join {
122
124
  this.sourceExpr = sourceExpr;
123
125
  this.elementType = 'joinOnExpr';
124
126
  this.joinType = 'one';
127
+ this.matrixOperation = 'left';
125
128
  }
126
129
  set joinOn(joinExpr) {
127
130
  this.expr = joinExpr;
@@ -152,9 +155,17 @@ class ExpressionJoin extends Join {
152
155
  return error_factory_1.ErrorFactory.structDef;
153
156
  }
154
157
  const sourceDef = source.structDef();
158
+ let matrixOperation = 'left';
159
+ if (this.inExperiment('join_types', true)) {
160
+ matrixOperation = this.matrixOperation;
161
+ }
155
162
  const joinStruct = {
156
163
  ...sourceDef,
157
- structRelationship: { type: this.joinType },
164
+ // MTOY: add matrix type here
165
+ structRelationship: {
166
+ type: this.joinType,
167
+ matrixOperation,
168
+ },
158
169
  location: this.location,
159
170
  };
160
171
  if (sourceDef.structSource.type === 'query') {
@@ -55,105 +55,109 @@ export declare class MalloyLexer extends Lexer {
55
55
  static readonly EXCLUDE = 50;
56
56
  static readonly EXTEND = 51;
57
57
  static readonly FALSE = 52;
58
- static readonly FOR = 53;
59
- static readonly FROM = 54;
60
- static readonly FROM_SQL = 55;
61
- static readonly HAS = 56;
62
- static readonly HOUR = 57;
63
- static readonly IMPORT = 58;
64
- static readonly IS = 59;
65
- static readonly JSON = 60;
66
- static readonly LAST = 61;
67
- static readonly MAX = 62;
68
- static readonly MIN = 63;
69
- static readonly MINUTE = 64;
70
- static readonly MONTH = 65;
71
- static readonly NOT = 66;
72
- static readonly NOW = 67;
73
- static readonly NULL = 68;
74
- static readonly NUMBER = 69;
75
- static readonly ON = 70;
76
- static readonly OR = 71;
77
- static readonly PICK = 72;
78
- static readonly QUARTER = 73;
79
- static readonly REFINE = 74;
80
- static readonly SECOND = 75;
81
- static readonly STRING = 76;
82
- static readonly SOURCE_KW = 77;
83
- static readonly SUM = 78;
84
- static readonly SQL = 79;
85
- static readonly TABLE = 80;
86
- static readonly THEN = 81;
87
- static readonly THIS = 82;
88
- static readonly TIMESTAMP = 83;
89
- static readonly TO = 84;
90
- static readonly TRUE = 85;
91
- static readonly TURTLE = 86;
92
- static readonly WEEK = 87;
93
- static readonly WHEN = 88;
94
- static readonly WITH = 89;
95
- static readonly YEAR = 90;
96
- static readonly UNGROUPED = 91;
97
- static readonly STRING_ESCAPE = 92;
98
- static readonly HACKY_REGEX = 93;
99
- static readonly SQ_STRING = 94;
100
- static readonly DQ_STRING = 95;
101
- static readonly BQ_STRING = 96;
102
- static readonly DOC_ANNOTATION = 97;
103
- static readonly ANNOTATION = 98;
104
- static readonly AMPER = 99;
105
- static readonly ARROW = 100;
106
- static readonly FAT_ARROW = 101;
107
- static readonly OPAREN = 102;
108
- static readonly CPAREN = 103;
109
- static readonly OBRACK = 104;
110
- static readonly CBRACK = 105;
111
- static readonly OCURLY = 106;
112
- static readonly CCURLY = 107;
113
- static readonly DOUBLECOLON = 108;
114
- static readonly TRIPLECOLON = 109;
115
- static readonly EXCLAM = 110;
116
- static readonly COLON = 111;
117
- static readonly COMMA = 112;
118
- static readonly DOT = 113;
119
- static readonly LT = 114;
120
- static readonly GT = 115;
121
- static readonly EQ = 116;
122
- static readonly NE = 117;
123
- static readonly LTE = 118;
124
- static readonly GTE = 119;
125
- static readonly PLUS = 120;
126
- static readonly MINUS = 121;
127
- static readonly STAR = 122;
128
- static readonly STARSTAR = 123;
129
- static readonly SLASH = 124;
130
- static readonly BAR = 125;
131
- static readonly SEMI = 126;
132
- static readonly NOT_MATCH = 127;
133
- static readonly MATCH = 128;
134
- static readonly PERCENT = 129;
135
- static readonly DOUBLE_QMARK = 130;
136
- static readonly QMARK = 131;
137
- static readonly LITERAL_TIMESTAMP = 132;
138
- static readonly LITERAL_HOUR = 133;
139
- static readonly LITERAL_DAY = 134;
140
- static readonly LITERAL_QUARTER = 135;
141
- static readonly LITERAL_MONTH = 136;
142
- static readonly LITERAL_WEEK = 137;
143
- static readonly LITERAL_YEAR = 138;
144
- static readonly IDENTIFIER = 139;
145
- static readonly PERCENT_LITERAL = 140;
146
- static readonly NUMERIC_LITERAL = 141;
147
- static readonly INTEGER_LITERAL = 142;
148
- static readonly BLOCK_COMMENT = 143;
149
- static readonly COMMENT_TO_EOL = 144;
150
- static readonly WHITE_SPACE = 145;
151
- static readonly SQL_BEGIN = 146;
152
- static readonly CLOSE_CODE = 147;
153
- static readonly UNWATED_CHARS_TRAILING_NUMBERS = 148;
154
- static readonly UNEXPECTED_CHAR = 149;
155
- static readonly OPEN_CODE = 150;
156
- static readonly SQL_END = 151;
58
+ static readonly FULL = 53;
59
+ static readonly FOR = 54;
60
+ static readonly FROM = 55;
61
+ static readonly FROM_SQL = 56;
62
+ static readonly HAS = 57;
63
+ static readonly HOUR = 58;
64
+ static readonly IMPORT = 59;
65
+ static readonly INNER = 60;
66
+ static readonly IS = 61;
67
+ static readonly JSON = 62;
68
+ static readonly LAST = 63;
69
+ static readonly LEFT = 64;
70
+ static readonly MAX = 65;
71
+ static readonly MIN = 66;
72
+ static readonly MINUTE = 67;
73
+ static readonly MONTH = 68;
74
+ static readonly NOT = 69;
75
+ static readonly NOW = 70;
76
+ static readonly NULL = 71;
77
+ static readonly NUMBER = 72;
78
+ static readonly ON = 73;
79
+ static readonly OR = 74;
80
+ static readonly PICK = 75;
81
+ static readonly QUARTER = 76;
82
+ static readonly REFINE = 77;
83
+ static readonly RIGHT = 78;
84
+ static readonly SECOND = 79;
85
+ static readonly STRING = 80;
86
+ static readonly SOURCE_KW = 81;
87
+ static readonly SUM = 82;
88
+ static readonly SQL = 83;
89
+ static readonly TABLE = 84;
90
+ static readonly THEN = 85;
91
+ static readonly THIS = 86;
92
+ static readonly TIMESTAMP = 87;
93
+ static readonly TO = 88;
94
+ static readonly TRUE = 89;
95
+ static readonly TURTLE = 90;
96
+ static readonly WEEK = 91;
97
+ static readonly WHEN = 92;
98
+ static readonly WITH = 93;
99
+ static readonly YEAR = 94;
100
+ static readonly UNGROUPED = 95;
101
+ static readonly STRING_ESCAPE = 96;
102
+ static readonly HACKY_REGEX = 97;
103
+ static readonly SQ_STRING = 98;
104
+ static readonly DQ_STRING = 99;
105
+ static readonly BQ_STRING = 100;
106
+ static readonly DOC_ANNOTATION = 101;
107
+ static readonly ANNOTATION = 102;
108
+ static readonly AMPER = 103;
109
+ static readonly ARROW = 104;
110
+ static readonly FAT_ARROW = 105;
111
+ static readonly OPAREN = 106;
112
+ static readonly CPAREN = 107;
113
+ static readonly OBRACK = 108;
114
+ static readonly CBRACK = 109;
115
+ static readonly OCURLY = 110;
116
+ static readonly CCURLY = 111;
117
+ static readonly DOUBLECOLON = 112;
118
+ static readonly TRIPLECOLON = 113;
119
+ static readonly EXCLAM = 114;
120
+ static readonly COLON = 115;
121
+ static readonly COMMA = 116;
122
+ static readonly DOT = 117;
123
+ static readonly LT = 118;
124
+ static readonly GT = 119;
125
+ static readonly EQ = 120;
126
+ static readonly NE = 121;
127
+ static readonly LTE = 122;
128
+ static readonly GTE = 123;
129
+ static readonly PLUS = 124;
130
+ static readonly MINUS = 125;
131
+ static readonly STAR = 126;
132
+ static readonly STARSTAR = 127;
133
+ static readonly SLASH = 128;
134
+ static readonly BAR = 129;
135
+ static readonly SEMI = 130;
136
+ static readonly NOT_MATCH = 131;
137
+ static readonly MATCH = 132;
138
+ static readonly PERCENT = 133;
139
+ static readonly DOUBLE_QMARK = 134;
140
+ static readonly QMARK = 135;
141
+ static readonly LITERAL_TIMESTAMP = 136;
142
+ static readonly LITERAL_HOUR = 137;
143
+ static readonly LITERAL_DAY = 138;
144
+ static readonly LITERAL_QUARTER = 139;
145
+ static readonly LITERAL_MONTH = 140;
146
+ static readonly LITERAL_WEEK = 141;
147
+ static readonly LITERAL_YEAR = 142;
148
+ static readonly IDENTIFIER = 143;
149
+ static readonly PERCENT_LITERAL = 144;
150
+ static readonly NUMERIC_LITERAL = 145;
151
+ static readonly INTEGER_LITERAL = 146;
152
+ static readonly BLOCK_COMMENT = 147;
153
+ static readonly COMMENT_TO_EOL = 148;
154
+ static readonly WHITE_SPACE = 149;
155
+ static readonly SQL_BEGIN = 150;
156
+ static readonly CLOSE_CODE = 151;
157
+ static readonly UNWATED_CHARS_TRAILING_NUMBERS = 152;
158
+ static readonly UNEXPECTED_CHAR = 153;
159
+ static readonly OPEN_CODE = 154;
160
+ static readonly SQL_END = 155;
157
161
  static readonly SQL_MODE = 1;
158
162
  static readonly channelNames: string[];
159
163
  static readonly modeNames: string[];