@malloydata/malloy 0.0.225-dev250106171109 → 0.0.225-dev250111002123

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.
@@ -145,7 +145,7 @@ class SnowflakeDialect extends dialect_1.Dialect {
145
145
  sqlUnnestAlias(source, alias, _fieldList, _needDistinctKey, isArray, _isInNestedPipeline) {
146
146
  const as = this.sqlMaybeQuoteIdentifier(alias);
147
147
  if (isArray) {
148
- return `,LATERAL FLATTEN(INPUT => ${source}) AS ${alias}_1, LATERAL (SELECT ${alias}_1.INDEX, object_construct('value', ${alias}_1.value) as value ) as ${as}`;
148
+ return `LEFT JOIN lateral flatten(input => ${source}) as ${as}`;
149
149
  }
150
150
  else {
151
151
  // have to have a non empty row or it treats it like an inner join :barf-emoji:
@@ -197,9 +197,11 @@ class SnowflakeDialect extends dialect_1.Dialect {
197
197
  if (childName === '__row_id') {
198
198
  return `"${parentAlias}".INDEX::varchar`;
199
199
  }
200
- else if (parentType === 'array[scalar]' ||
201
- parentType === 'array[record]') {
202
- const arrayRef = `"${parentAlias}".value:${sqlName}`;
200
+ else if (parentType.startsWith('array')) {
201
+ let arrayRef = `"${parentAlias}".value`;
202
+ if (parentType === 'array[record]') {
203
+ arrayRef += `:${sqlName}`;
204
+ }
203
205
  switch (childType) {
204
206
  case 'record':
205
207
  case 'array':
@@ -119,7 +119,6 @@ class DynamicSpace extends static_space_1.StaticSpace {
119
119
  const fields = [];
120
120
  const joins = [];
121
121
  const turtles = [];
122
- const fixupJoins = [];
123
122
  for (const [name, spaceEntry] of this.entries()) {
124
123
  if (spaceEntry instanceof struct_space_field_base_1.StructSpaceFieldBase) {
125
124
  joins.push([name, spaceEntry]);
@@ -139,7 +138,7 @@ class DynamicSpace extends static_space_1.StaticSpace {
139
138
  if (!error_factory_1.ErrorFactory.didCreate(joinStruct)) {
140
139
  fieldIndices.set(name, this.sourceDef.fields.length);
141
140
  this.sourceDef.fields.push(joinStruct);
142
- fixupJoins.push([field.join, joinStruct]);
141
+ field.join.fixupJoinOn(this, joinStruct);
143
142
  }
144
143
  }
145
144
  else {
@@ -155,10 +154,6 @@ class DynamicSpace extends static_space_1.StaticSpace {
155
154
  // }
156
155
  }
157
156
  }
158
- // If we have join expressions, we need to now go back and fill them in
159
- for (const [join, missingOn] of fixupJoins) {
160
- join.fixupJoinOn(this, missingOn);
161
- }
162
157
  // Add access modifiers at the end so views don't obey them
163
158
  for (const [name, access] of this.newAccessModifiers) {
164
159
  const index = this.sourceDef.fields.findIndex(f => { var _a; return (_a = f.as) !== null && _a !== void 0 ? _a : f.name === name; });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.225-dev250106171109",
3
+ "version": "0.0.225-dev250111002123",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",