@malloydata/render 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.
@@ -4170,7 +4170,7 @@ class hxe extends lp.Dialect {
4170
4170
  }
4171
4171
  sqlUnnestAlias(e, n, r, i, s, o) {
4172
4172
  const u = this.sqlMaybeQuoteIdentifier(n);
4173
- return s ? `,LATERAL FLATTEN(INPUT => ${e}) AS ${n}_1, LATERAL (SELECT ${n}_1.INDEX, object_construct('value', ${n}_1.value) as value ) as ${u}` : `LEFT JOIN LATERAL FLATTEN(INPUT => ifnull(${e},[1])) AS ${u}`;
4173
+ return s ? `LEFT JOIN lateral flatten(input => ${e}) as ${u}` : `LEFT JOIN LATERAL FLATTEN(INPUT => ifnull(${e},[1])) AS ${u}`;
4174
4174
  }
4175
4175
  /*
4176
4176
  // For comparison against the equivalent function implemented in standardsql dialect
@@ -4210,9 +4210,9 @@ class hxe extends lp.Dialect {
4210
4210
  const s = this.sqlMaybeQuoteIdentifier(r);
4211
4211
  if (r === "__row_id")
4212
4212
  return `"${e}".INDEX::varchar`;
4213
- if (n === "array[scalar]" || n === "array[record]") {
4214
- const o = `"${e}".value:${s}`;
4215
- switch (i) {
4213
+ if (n.startsWith("array")) {
4214
+ let o = `"${e}".value`;
4215
+ switch (n === "array[record]" && (o += `:${s}`), i) {
4216
4216
  case "record":
4217
4217
  case "array":
4218
4218
  i = "VARIANT";
@@ -42046,48 +42046,46 @@ class uye extends iye.StaticSpace {
42046
42046
  structDef() {
42047
42047
  if (this.complete = !0, this.sourceDef === void 0) {
42048
42048
  const e = {};
42049
- for (const [l, c] of this.entries())
42050
- c instanceof _M.SpaceParam && (e[l] = c.parameter());
42049
+ for (const [a, l] of this.entries())
42050
+ l instanceof _M.SpaceParam && (e[a] = l.parameter());
42051
42051
  this.sourceDef = { ...this.fromSource, fields: [] }, this.sourceDef.parameters = e;
42052
- const n = /* @__PURE__ */ new Map(), r = [], i = [], s = [], o = [];
42053
- for (const [l, c] of this.entries())
42054
- c instanceof sye.StructSpaceFieldBase ? i.push([l, c]) : c instanceof rye.ViewField ? s.push([l, c]) : c instanceof tye.SpaceField && r.push([l, c]);
42055
- const u = [...r, ...i, ...s], a = this.parameterSpace();
42056
- for (const [l, c] of u)
42057
- if (c instanceof nye.JoinSpaceField) {
42058
- const f = c.join.structDef(a);
42059
- eye.ErrorFactory.didCreate(f) || (n.set(l, this.sourceDef.fields.length), this.sourceDef.fields.push(f), o.push([c.join, f]));
42052
+ const n = /* @__PURE__ */ new Map(), r = [], i = [], s = [];
42053
+ for (const [a, l] of this.entries())
42054
+ l instanceof sye.StructSpaceFieldBase ? i.push([a, l]) : l instanceof rye.ViewField ? s.push([a, l]) : l instanceof tye.SpaceField && r.push([a, l]);
42055
+ const o = [...r, ...i, ...s], u = this.parameterSpace();
42056
+ for (const [a, l] of o)
42057
+ if (l instanceof nye.JoinSpaceField) {
42058
+ const c = l.join.structDef(u);
42059
+ eye.ErrorFactory.didCreate(c) || (n.set(a, this.sourceDef.fields.length), this.sourceDef.fields.push(c), l.join.fixupJoinOn(this, c));
42060
42060
  } else {
42061
- const f = c.fieldDef();
42062
- f && (n.set(l, this.sourceDef.fields.length), this.sourceDef.fields.push(f));
42061
+ const c = l.fieldDef();
42062
+ c && (n.set(a, this.sourceDef.fields.length), this.sourceDef.fields.push(c));
42063
42063
  }
42064
- for (const [l, c] of o)
42065
- l.fixupJoinOn(this, c);
42066
- for (const [l, c] of this.newAccessModifiers) {
42067
- const f = this.sourceDef.fields.findIndex((x) => {
42068
- var h;
42069
- return (h = x.as) !== null && h !== void 0 ? h : x.name === l;
42064
+ for (const [a, l] of this.newAccessModifiers) {
42065
+ const c = this.sourceDef.fields.findIndex((f) => {
42066
+ var x;
42067
+ return (x = f.as) !== null && x !== void 0 ? x : f.name === a;
42070
42068
  });
42071
- if (f === -1)
42072
- throw new Error(`Can't find field '${l}' to set access modifier`);
42073
- c === "public" ? delete this.sourceDef.fields[f].accessModifier : this.sourceDef.fields[f] = {
42074
- ...this.sourceDef.fields[f],
42075
- accessModifier: c
42069
+ if (c === -1)
42070
+ throw new Error(`Can't find field '${a}' to set access modifier`);
42071
+ l === "public" ? delete this.sourceDef.fields[c].accessModifier : this.sourceDef.fields[c] = {
42072
+ ...this.sourceDef.fields[c],
42073
+ accessModifier: l
42076
42074
  };
42077
42075
  }
42078
- for (const [l, c] of this.newNotes) {
42079
- const f = this.sourceDef.fields.findIndex((h) => {
42080
- var p;
42081
- return (p = h.as) !== null && p !== void 0 ? p : h.name === l;
42076
+ for (const [a, l] of this.newNotes) {
42077
+ const c = this.sourceDef.fields.findIndex((x) => {
42078
+ var h;
42079
+ return (h = x.as) !== null && h !== void 0 ? h : x.name === a;
42082
42080
  });
42083
- if (f === -1)
42084
- throw new Error(`Can't find field '${l}' to set access modifier`);
42085
- const x = this.sourceDef.fields[f];
42086
- this.sourceDef.fields[f] = {
42087
- ...x,
42081
+ if (c === -1)
42082
+ throw new Error(`Can't find field '${a}' to set access modifier`);
42083
+ const f = this.sourceDef.fields[c];
42084
+ this.sourceDef.fields[c] = {
42085
+ ...f,
42088
42086
  annotation: {
42089
- ...c,
42090
- inherits: x.annotation
42087
+ ...l,
42088
+ inherits: f.annotation
42091
42089
  }
42092
42090
  };
42093
42091
  }