lakeql 0.1.8 → 0.2.0

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.
@@ -35,6 +35,8 @@ var ERROR_CODES = [
35
35
  "LAKEQL_BUDGET_EXCEEDED",
36
36
  "LAKEQL_GROUP_LIMIT_EXCEEDED",
37
37
  "LAKEQL_OBJECT_NOT_FOUND",
38
+ "LAKEQL_NO_FILES_MATCHED",
39
+ "LAKEQL_SCHEMA_CONFLICT",
38
40
  "LAKEQL_CATALOG_ERROR",
39
41
  "LAKEQL_UNSUPPORTED_ICEBERG_FEATURE",
40
42
  "LAKEQL_UNSUPPORTED_PARQUET_FEATURE",
@@ -157,6 +159,147 @@ function fractionForUnit(nanos, unit) {
157
159
  }
158
160
  }
159
161
 
162
+ // ../core/dist/interval.js
163
+ var NANOS_PER_SECOND = 1000000000n;
164
+ var NANOS_PER_MILLI2 = 1000000n;
165
+ var NANOS_PER_MICRO2 = 1000n;
166
+ function intervalValue(input) {
167
+ const trimmed = input.trim();
168
+ if (trimmed.length === 0)
169
+ throwInterval(input);
170
+ let rest = trimmed;
171
+ let months = 0;
172
+ let days = 0;
173
+ let nanoseconds = 0n;
174
+ let matchedAny = false;
175
+ const leadingTime = /^([+-]?\d{1,2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?)\b/u.exec(rest);
176
+ if (leadingTime?.[1] !== void 0) {
177
+ nanoseconds += parseIntervalTime(leadingTime[1], input);
178
+ rest = rest.slice(leadingTime[0].length).trim();
179
+ matchedAny = true;
180
+ }
181
+ const partPattern = /([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(years?|mons?|months?|days?|hours?|hrs?|minutes?|mins?|seconds?|secs?|milliseconds?|millis?|microseconds?|micros?|nanoseconds?|nanos?)\b/giu;
182
+ let cursor = 0;
183
+ for (const match of rest.matchAll(partPattern)) {
184
+ if (match.index === void 0 || rest.slice(cursor, match.index).trim().length > 0) {
185
+ throwInterval(input);
186
+ }
187
+ const amount = Number(match[1]);
188
+ const unit = match[2]?.toLowerCase() ?? "";
189
+ if (!Number.isFinite(amount))
190
+ throwInterval(input);
191
+ if (unit.startsWith("year"))
192
+ months += integerAmount(amount, unit, input) * 12;
193
+ else if (unit === "mon" || unit === "mons" || unit.startsWith("month"))
194
+ months += integerAmount(amount, unit, input);
195
+ else if (unit.startsWith("day"))
196
+ days += integerAmount(amount, unit, input);
197
+ else if (unit.startsWith("hour") || unit === "hr" || unit === "hrs")
198
+ nanoseconds += decimalNanoseconds(match[1] ?? "", 60n * 60n * NANOS_PER_SECOND);
199
+ else if (unit.startsWith("minute") || unit === "min" || unit === "mins")
200
+ nanoseconds += decimalNanoseconds(match[1] ?? "", 60n * NANOS_PER_SECOND);
201
+ else if (unit.startsWith("second") || unit === "sec" || unit === "secs")
202
+ nanoseconds += decimalNanoseconds(match[1] ?? "", NANOS_PER_SECOND);
203
+ else if (unit.startsWith("millisecond") || unit === "milli" || unit === "millis")
204
+ nanoseconds += decimalNanoseconds(match[1] ?? "", NANOS_PER_MILLI2);
205
+ else if (unit.startsWith("microsecond") || unit === "micro" || unit === "micros")
206
+ nanoseconds += decimalNanoseconds(match[1] ?? "", NANOS_PER_MICRO2);
207
+ else if (unit.startsWith("nanosecond") || unit === "nano" || unit === "nanos")
208
+ nanoseconds += BigInt(integerAmount(amount, unit, input));
209
+ else
210
+ throwInterval(input);
211
+ matchedAny = true;
212
+ cursor = match.index + match[0].length;
213
+ const after = rest.slice(cursor).trimStart();
214
+ const time = /^(\d{1,2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?)\b/u.exec(after);
215
+ if (time?.[1] !== void 0) {
216
+ nanoseconds += parseIntervalTime(time[1], input);
217
+ cursor = rest.length - after.slice(time[0].length).length;
218
+ }
219
+ }
220
+ if (!matchedAny || rest.slice(cursor).trim().length > 0)
221
+ throwInterval(input);
222
+ return { kind: "interval", months, days, nanoseconds: nanoseconds.toString() };
223
+ }
224
+ function isIntervalValue(value) {
225
+ return typeof value === "object" && value !== null && "kind" in value && value.kind === "interval" && "months" in value && Number.isInteger(value.months) && "days" in value && Number.isInteger(value.days) && "nanoseconds" in value && typeof value.nanoseconds === "string" && /^-?[0-9]+$/u.test(value.nanoseconds);
226
+ }
227
+ function isNonNegativeInterval(value) {
228
+ return value.months >= 0 && value.days >= 0 && BigInt(value.nanoseconds) >= 0n;
229
+ }
230
+ function intervalToString(value) {
231
+ const parts = [];
232
+ if (value.months !== 0)
233
+ parts.push(`${value.months} months`);
234
+ if (value.days !== 0)
235
+ parts.push(`${value.days} days`);
236
+ const nanos = BigInt(value.nanoseconds);
237
+ if (nanos !== 0n || parts.length === 0)
238
+ parts.push(`${nanos} nanoseconds`);
239
+ return parts.join(" ");
240
+ }
241
+ function applyIntervalToTimestamp(value, interval, direction) {
242
+ const date = new Date(Number(value.epochNanoseconds / NANOS_PER_MILLI2));
243
+ if (interval.months !== 0)
244
+ shiftUtcMonthsClamped(date, direction * interval.months);
245
+ if (interval.days !== 0)
246
+ date.setUTCDate(date.getUTCDate() + direction * interval.days);
247
+ const nanosWithinMilli = value.epochNanoseconds % NANOS_PER_MILLI2;
248
+ const epochNanoseconds2 = BigInt(date.getTime()) * NANOS_PER_MILLI2 + nanosWithinMilli + BigInt(direction) * BigInt(interval.nanoseconds);
249
+ return new TimestampValue(epochNanoseconds2, value.unit, value.isAdjustedToUTC);
250
+ }
251
+ function integerAmount(value, unit, input) {
252
+ if (!Number.isInteger(value)) {
253
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", `Interval ${unit} component must be an integer`, {
254
+ interval: input,
255
+ unit
256
+ });
257
+ }
258
+ return value;
259
+ }
260
+ function decimalNanoseconds(value, unitNanos) {
261
+ const match = /^([+-]?)(?:(\d+)(?:\.(\d+))?|\.(\d+))$/u.exec(value);
262
+ if (match === null) {
263
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", "Interval component exceeds nanosecond precision");
264
+ }
265
+ const sign = match[1] === "-" ? -1n : 1n;
266
+ const whole = BigInt(match[2] ?? "0");
267
+ const fraction = match[3] ?? match[4] ?? "";
268
+ const scale = 10n ** BigInt(fraction.length);
269
+ const numerator = whole * scale + BigInt(fraction || "0");
270
+ const scaled = numerator * unitNanos;
271
+ if (scaled % scale !== 0n) {
272
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", "Interval component exceeds nanosecond precision");
273
+ }
274
+ return sign * (scaled / scale);
275
+ }
276
+ function shiftUtcMonthsClamped(date, months) {
277
+ const day = date.getUTCDate();
278
+ const targetMonthStart = new Date(date.getTime());
279
+ targetMonthStart.setUTCDate(1);
280
+ targetMonthStart.setUTCMonth(targetMonthStart.getUTCMonth() + months);
281
+ const daysInTargetMonth = new Date(Date.UTC(targetMonthStart.getUTCFullYear(), targetMonthStart.getUTCMonth() + 1, 0)).getUTCDate();
282
+ date.setUTCFullYear(targetMonthStart.getUTCFullYear(), targetMonthStart.getUTCMonth(), Math.min(day, daysInTargetMonth));
283
+ }
284
+ function parseIntervalTime(value, input) {
285
+ const match = /^([+-]?\d{1,2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?$/u.exec(value);
286
+ if (match === null || match[1] === void 0 || match[2] === void 0)
287
+ throwInterval(input);
288
+ const sign = match[1].startsWith("-") ? -1n : 1n;
289
+ const hours = BigInt(Math.abs(Number(match[1])));
290
+ const minutes = BigInt(Number(match[2]));
291
+ const seconds = BigInt(Number(match[3] ?? "0"));
292
+ if (minutes >= 60n || seconds >= 60n)
293
+ throwInterval(input);
294
+ const fraction = BigInt((match[4] ?? "").padEnd(9, "0") || "0");
295
+ return sign * ((hours * 60n + minutes) * 60n * NANOS_PER_SECOND + seconds * NANOS_PER_SECOND + fraction);
296
+ }
297
+ function throwInterval(input) {
298
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", `Invalid interval literal ${input}`, {
299
+ interval: input
300
+ });
301
+ }
302
+
160
303
  // ../core/dist/regex-functions.js
161
304
  function regexpMatchesValue(value, pattern, options = "") {
162
305
  const regexOptions = parseRegexOptions("regexp_matches", options, { allowGlobal: false });
@@ -234,6 +377,7 @@ var GEO_BACKEND_FUNCTIONS = /* @__PURE__ */ new Set([
234
377
  "st_disjoint",
235
378
  "st_contains",
236
379
  "st_within",
380
+ "st_dwithin",
237
381
  "h3_within",
238
382
  "h3_cell",
239
383
  "h3_parent"
@@ -251,7 +395,7 @@ function requireGeoBackend() {
251
395
  async function loadGeoBackend() {
252
396
  if (geoBackend !== null)
253
397
  return;
254
- const module = await import('./geo-backend-TSQJWAAB.js');
398
+ const module = await import('./geo-backend-WYCTLPNS.js');
255
399
  module.installGeoBackend();
256
400
  }
257
401
  async function ensureGeoBackendForExprs(exprs) {
@@ -341,6 +485,10 @@ function matches(expr, row) {
341
485
  function jsonSafeValue(value) {
342
486
  if (isTimestampValue(value))
343
487
  return value.toJSON();
488
+ if (isIntervalValue(value))
489
+ return intervalToString(value);
490
+ if (value instanceof Uint8Array)
491
+ return bytesToHex(value);
344
492
  if (typeof value === "bigint") {
345
493
  const asNumber = Number(value);
346
494
  return Number.isSafeInteger(asNumber) ? asNumber : value.toString();
@@ -364,7 +512,7 @@ function rowValue(row, name) {
364
512
  throw new LakeqlError("LAKEQL_UNKNOWN_COLUMN", `Unknown column ${name}`, { column: name });
365
513
  }
366
514
  const value = row[name];
367
- if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint" || isTimestampValue(value)) {
515
+ if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint" || value instanceof Uint8Array || isTimestampValue(value) || isIntervalValue(value)) {
368
516
  return value;
369
517
  }
370
518
  throw new LakeqlError("LAKEQL_TYPE_ERROR", `Column ${name} is not a scalar value`, {
@@ -384,6 +532,12 @@ function toSqlBoolean(value) {
384
532
  function compare(op, left, right) {
385
533
  if (left === null || right === null)
386
534
  return null;
535
+ if (left instanceof Uint8Array || right instanceof Uint8Array) {
536
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", "Cannot compare binary values", {
537
+ leftType: evalValueType(left),
538
+ rightType: evalValueType(right)
539
+ });
540
+ }
387
541
  if (isTimestampValue(left) || isTimestampValue(right)) {
388
542
  const leftTimestamp = timestampEvalValue(left);
389
543
  const rightTimestamp = timestampEvalValue(right);
@@ -395,6 +549,12 @@ function compare(op, left, right) {
395
549
  }
396
550
  return compareOrder(op, compareTimestampValues(leftTimestamp, rightTimestamp));
397
551
  }
552
+ if (isIntervalValue(left) || isIntervalValue(right)) {
553
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", "Cannot compare interval values", {
554
+ leftType: evalValueType(left),
555
+ rightType: evalValueType(right)
556
+ });
557
+ }
398
558
  if (typeof left !== typeof right && !(isNumberLike(left) && isNumberLike(right))) {
399
559
  throw new LakeqlError("LAKEQL_TYPE_ERROR", "Cannot compare values of different types", {
400
560
  leftType: typeof left,
@@ -428,6 +588,10 @@ function timestampEvalValue(value) {
428
588
  return void 0;
429
589
  }
430
590
  function evalValueType(value) {
591
+ if (value instanceof Uint8Array)
592
+ return "binary";
593
+ if (isIntervalValue(value))
594
+ return "interval";
431
595
  return isTimestampValue(value) ? "timestamp" : typeof value;
432
596
  }
433
597
  function arithmetic(op, left, right) {
@@ -572,6 +736,8 @@ function callFunction(name, args) {
572
736
  return spatialPredicate(fn, args, "within");
573
737
  case "st_disjoint":
574
738
  return spatialPredicate(fn, args, "disjoint");
739
+ case "st_dwithin":
740
+ return stDWithin(fn, args);
575
741
  case "st_distance":
576
742
  return spatialMeasurement(fn, args, bboxDistance);
577
743
  case "st_area":
@@ -731,6 +897,24 @@ function spatialPredicate(name, args, op) {
731
897
  return bboxContains(eb, ea) && geo.booleanContains(b, a);
732
898
  }
733
899
  }
900
+ function stDWithin(name, args) {
901
+ requireArgCount(name, args, 3);
902
+ const left = args[0] ?? null;
903
+ const right = args[1] ?? null;
904
+ const distance = args[2] ?? null;
905
+ if (left === null || right === null || distance === null)
906
+ return null;
907
+ if (typeof distance !== "number" || !Number.isFinite(distance) || distance < 0) {
908
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", "st_dwithin() expects a non-negative distance");
909
+ }
910
+ const a = toGeometry(parseGeometry(left, name), name);
911
+ const b = toGeometry(parseGeometry(right, name), name);
912
+ const ea = envelopeOf(a);
913
+ const eb = envelopeOf(b);
914
+ if (bboxDistance(ea, eb) > distance)
915
+ return false;
916
+ return geometryDistance(a, b) <= distance;
917
+ }
734
918
  function envelopeOf(geometry) {
735
919
  switch (geometry.type) {
736
920
  case "Point":
@@ -874,8 +1058,10 @@ function envelope(value, name) {
874
1058
  return envelopeFromGeometry(parseGeometry(value, name), name);
875
1059
  }
876
1060
  function parseGeometry(value, name) {
1061
+ if (value instanceof Uint8Array)
1062
+ return parseWkbGeometry(value, name);
877
1063
  if (typeof value !== "string")
878
- throwType(name, "GeoJSON or BBox JSON string", value);
1064
+ throwType(name, "GeoJSON, WKT point, BBox JSON, or WKB bytes", value);
879
1065
  const wkt = parseWktGeometry(value);
880
1066
  if (wkt !== void 0)
881
1067
  return wkt;
@@ -892,6 +1078,129 @@ function parseGeometry(value, name) {
892
1078
  }
893
1079
  return parsed;
894
1080
  }
1081
+ function parseWkbGeometry(value, name) {
1082
+ const reader = new WkbReader(value, name);
1083
+ const geometry = reader.geometry();
1084
+ if (!reader.done()) {
1085
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", `${name}() received trailing WKB bytes`);
1086
+ }
1087
+ return geometry;
1088
+ }
1089
+ var WkbReader = class {
1090
+ bytes;
1091
+ name;
1092
+ offset = 0;
1093
+ littleEndian = true;
1094
+ constructor(bytes, name) {
1095
+ this.bytes = bytes;
1096
+ this.name = name;
1097
+ }
1098
+ done() {
1099
+ return this.offset === this.bytes.byteLength;
1100
+ }
1101
+ geometry() {
1102
+ this.byteOrder();
1103
+ const header = this.typeHeader();
1104
+ if (header.hasSrid)
1105
+ this.uint32();
1106
+ switch (header.type) {
1107
+ case 1:
1108
+ return { type: "Point", coordinates: this.position(header.dimensions) };
1109
+ case 2:
1110
+ return { type: "LineString", coordinates: this.positions(header.dimensions) };
1111
+ case 3:
1112
+ return {
1113
+ type: "Polygon",
1114
+ coordinates: this.rings(header.dimensions)
1115
+ };
1116
+ default:
1117
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", `${this.name}() supports WKB Point, LineString, or Polygon geometry`, { wkbType: header.rawType });
1118
+ }
1119
+ }
1120
+ byteOrder() {
1121
+ const order = this.uint8();
1122
+ if (order === 0) {
1123
+ this.littleEndian = false;
1124
+ return;
1125
+ }
1126
+ if (order === 1) {
1127
+ this.littleEndian = true;
1128
+ return;
1129
+ }
1130
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", `${this.name}() WKB byte order is invalid`);
1131
+ }
1132
+ typeHeader() {
1133
+ const rawType = this.uint32();
1134
+ const hasZFlag = (rawType & 2147483648) !== 0;
1135
+ const hasMFlag = (rawType & 1073741824) !== 0;
1136
+ const hasSrid = (rawType & 536870912) !== 0;
1137
+ const baseWithEwkbFlags = rawType & 268435455;
1138
+ const isoFamily = Math.trunc(baseWithEwkbFlags / 1e3);
1139
+ const type = baseWithEwkbFlags % 1e3;
1140
+ const hasZ = hasZFlag || isoFamily === 1 || isoFamily === 3;
1141
+ const hasM = hasMFlag || isoFamily === 2 || isoFamily === 3;
1142
+ return {
1143
+ rawType,
1144
+ type,
1145
+ dimensions: 2 + (hasZ ? 1 : 0) + (hasM ? 1 : 0),
1146
+ hasSrid
1147
+ };
1148
+ }
1149
+ rings(dimensions) {
1150
+ const count = this.uint32();
1151
+ const rings = [];
1152
+ for (let index = 0; index < count; index += 1) {
1153
+ rings.push(this.positions(dimensions));
1154
+ }
1155
+ return rings;
1156
+ }
1157
+ positions(dimensions) {
1158
+ const count = this.uint32();
1159
+ const points = [];
1160
+ for (let index = 0; index < count; index += 1) {
1161
+ points.push(this.position(dimensions));
1162
+ }
1163
+ return points;
1164
+ }
1165
+ position(dimensions) {
1166
+ if (dimensions < 2) {
1167
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", `${this.name}() WKB coordinate dimension is invalid`);
1168
+ }
1169
+ const x = this.float64();
1170
+ const y = this.float64();
1171
+ for (let index = 2; index < dimensions; index += 1)
1172
+ this.float64();
1173
+ if (!Number.isFinite(x) || !Number.isFinite(y)) {
1174
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", `${this.name}() WKB coordinates must be finite`);
1175
+ }
1176
+ return [x, y];
1177
+ }
1178
+ uint8() {
1179
+ this.require(1);
1180
+ const value = this.bytes[this.offset];
1181
+ this.offset += 1;
1182
+ return value ?? 0;
1183
+ }
1184
+ uint32() {
1185
+ this.require(4);
1186
+ const view = new DataView(this.bytes.buffer, this.bytes.byteOffset + this.offset, 4);
1187
+ const value = view.getUint32(0, this.littleEndian);
1188
+ this.offset += 4;
1189
+ return value;
1190
+ }
1191
+ float64() {
1192
+ this.require(8);
1193
+ const view = new DataView(this.bytes.buffer, this.bytes.byteOffset + this.offset, 8);
1194
+ const value = view.getFloat64(0, this.littleEndian);
1195
+ this.offset += 8;
1196
+ return value;
1197
+ }
1198
+ require(bytes) {
1199
+ if (this.offset + bytes > this.bytes.byteLength) {
1200
+ throw new LakeqlError("LAKEQL_TYPE_ERROR", `${this.name}() received truncated WKB`);
1201
+ }
1202
+ }
1203
+ };
895
1204
  function parseWktGeometry(value) {
896
1205
  const point = /^POINT\s*\(\s*([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)\s+([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)\s*\)$/iu.exec(value);
897
1206
  if (point !== null) {
@@ -956,6 +1265,113 @@ function bboxDistance(left, right) {
956
1265
  const dy = left.maxy < right.miny ? right.miny - left.maxy : right.maxy < left.miny ? left.miny - right.maxy : 0;
957
1266
  return Math.hypot(dx, dy);
958
1267
  }
1268
+ function geometryDistance(left, right) {
1269
+ if (requireGeoBackend().booleanIntersects(left, right))
1270
+ return 0;
1271
+ const leftSegments = geometrySegments(left);
1272
+ const rightSegments = geometrySegments(right);
1273
+ const leftPoints = geometryPoints(left);
1274
+ const rightPoints = geometryPoints(right);
1275
+ let best = Number.POSITIVE_INFINITY;
1276
+ for (const point of leftPoints) {
1277
+ for (const other of rightPoints)
1278
+ best = Math.min(best, pointDistance(point, other));
1279
+ for (const segment of rightSegments)
1280
+ best = Math.min(best, pointSegmentDistance(point, segment));
1281
+ }
1282
+ for (const point of rightPoints) {
1283
+ for (const segment of leftSegments)
1284
+ best = Math.min(best, pointSegmentDistance(point, segment));
1285
+ }
1286
+ for (const leftSegment of leftSegments) {
1287
+ for (const rightSegment of rightSegments) {
1288
+ best = Math.min(best, segmentDistance(leftSegment, rightSegment));
1289
+ }
1290
+ }
1291
+ return best;
1292
+ }
1293
+ function geometryPoints(geometry) {
1294
+ switch (geometry.type) {
1295
+ case "Point":
1296
+ return [geometry.coordinates];
1297
+ case "LineString":
1298
+ return geometry.coordinates;
1299
+ case "Polygon":
1300
+ return geometry.coordinates.flat();
1301
+ }
1302
+ }
1303
+ function geometrySegments(geometry) {
1304
+ switch (geometry.type) {
1305
+ case "Point":
1306
+ return [];
1307
+ case "LineString":
1308
+ return pathSegments(geometry.coordinates, false);
1309
+ case "Polygon":
1310
+ return geometry.coordinates.flatMap((ring) => pathSegments(ring, true));
1311
+ }
1312
+ }
1313
+ function pathSegments(points, closed) {
1314
+ const out = [];
1315
+ for (let index = 1; index < points.length; index += 1) {
1316
+ const previous = points[index - 1];
1317
+ const current = points[index];
1318
+ if (previous !== void 0 && current !== void 0)
1319
+ out.push([previous, current]);
1320
+ }
1321
+ if (closed && points.length > 1) {
1322
+ const first = points[0];
1323
+ const last = points[points.length - 1];
1324
+ if (first !== void 0 && last !== void 0 && (first[0] !== last[0] || first[1] !== last[1])) {
1325
+ out.push([last, first]);
1326
+ }
1327
+ }
1328
+ return out;
1329
+ }
1330
+ function segmentDistance(left, right) {
1331
+ if (segmentsIntersect(left, right))
1332
+ return 0;
1333
+ return Math.min(pointSegmentDistance(left[0], right), pointSegmentDistance(left[1], right), pointSegmentDistance(right[0], left), pointSegmentDistance(right[1], left));
1334
+ }
1335
+ function pointDistance(left, right) {
1336
+ return Math.hypot(left[0] - right[0], left[1] - right[1]);
1337
+ }
1338
+ function pointSegmentDistance(point, segment) {
1339
+ const [start, end] = segment;
1340
+ const dx = end[0] - start[0];
1341
+ const dy = end[1] - start[1];
1342
+ const lengthSq = dx * dx + dy * dy;
1343
+ if (lengthSq === 0)
1344
+ return pointDistance(point, start);
1345
+ const t = Math.max(0, Math.min(1, ((point[0] - start[0]) * dx + (point[1] - start[1]) * dy) / lengthSq));
1346
+ return pointDistance(point, [start[0] + t * dx, start[1] + t * dy]);
1347
+ }
1348
+ function segmentsIntersect(left, right) {
1349
+ const [a, b] = left;
1350
+ const [c, d] = right;
1351
+ const abC = orientation(a, b, c);
1352
+ const abD = orientation(a, b, d);
1353
+ const cdA = orientation(c, d, a);
1354
+ const cdB = orientation(c, d, b);
1355
+ if (abC === 0 && pointOnSegment(c, left))
1356
+ return true;
1357
+ if (abD === 0 && pointOnSegment(d, left))
1358
+ return true;
1359
+ if (cdA === 0 && pointOnSegment(a, right))
1360
+ return true;
1361
+ if (cdB === 0 && pointOnSegment(b, right))
1362
+ return true;
1363
+ return abC * abD < 0 && cdA * cdB < 0;
1364
+ }
1365
+ function orientation(a, b, c) {
1366
+ const cross = (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
1367
+ if (Math.abs(cross) < Number.EPSILON)
1368
+ return 0;
1369
+ return cross > 0 ? 1 : -1;
1370
+ }
1371
+ function pointOnSegment(point, segment) {
1372
+ const [start, end] = segment;
1373
+ return point[0] >= Math.min(start[0], end[0]) && point[0] <= Math.max(start[0], end[0]) && point[1] >= Math.min(start[1], end[1]) && point[1] <= Math.max(start[1], end[1]);
1374
+ }
959
1375
  function geometryArea(geometry, name) {
960
1376
  if (geometry.type === "BBox") {
961
1377
  const box = bboxFromRecord(geometry, name);
@@ -1148,5 +1564,11 @@ function throwType(name, expected, value) {
1148
1564
  function pad(value) {
1149
1565
  return String(value).padStart(2, "0");
1150
1566
  }
1567
+ function bytesToHex(bytes) {
1568
+ let out = "";
1569
+ for (const byte of bytes)
1570
+ out += byte.toString(16).padStart(2, "0");
1571
+ return out;
1572
+ }
1151
1573
 
1152
- export { ERROR_CODES, LakeqlError, TimestampValue, __commonJS, __toESM, bboxIntersects, compareTimestampValues, encodeJsonLine, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, evaluate, isLakeqlError, isTimestampValue, jsonSafeValue, loadGeoBackend, matches, parseGeometry, regexpMatchesValue, regexpReplaceValue, requireGeoBackend, setGeoBackend, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry };
1574
+ export { ERROR_CODES, LakeqlError, TimestampValue, __commonJS, __toESM, applyIntervalToTimestamp, bboxDistance, bboxIntersects, compareTimestampValues, encodeJsonLine, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, evaluate, geometryDistance, intervalToString, intervalValue, isIntervalValue, isLakeqlError, isNonNegativeInterval, isTimestampValue, jsonSafeValue, loadGeoBackend, matches, parseGeometry, regexpMatchesValue, regexpReplaceValue, requireGeoBackend, setGeoBackend, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry };
@@ -1,5 +1,5 @@
1
1
  import { CacheAdapter, ObjectStore } from './index.js';
2
- export { AggregateExpr, AggregateGroupSnapshot, AggregateOp, AggregateOperatorState, AggregateOptions, AggregateParquetGroupTaskOptions, AggregateParquetGroupTasksOptions, AggregateParquetTaskOptions, AggregateParquetTasksOptions, AggregateResult, AggregateSnapshotValue, AggregateSpec, AggregateStateSnapshot, AggregationBuilder, ApplyIcebergDeletesOptions, ArithmeticExpr, BBox, BBoxIndex, Batch, BatchExprValues, BetweenExpr, Bookmark, BookmarkInit, BookmarkPosition, BookmarkQuery, BroadcastJoinOptions, CacheApiCache, CacheApiCacheOptions, CacheEntry, CachePolicy, CallExpr, CaseExpr, CaseWhenExpr, CheckpointAdapter, CheckpointStore, Clock, ColumnExpr, ColumnInput, CompareExpr, CompareOp, ConditionalObjectStore, ConditionalPutOptions, CreateParquetTableAsOptions, CreateParquetTableAsQuery, CreateParquetTableAsResult, CsvStreamOptions, DecodedIcebergDeletes, DecodedIcebergParquetDeletes, ERROR_CODES, EngineFilePlan, EngineTable, ErrorDetails, ExplainJson, ExplainResult, Expr, GeoBackend, GeoJsonGeometry, IcebergAppendFile, IcebergAppendOptions, IcebergAppendOutputManifestOptions, IcebergAppendResult, IcebergCatalog, IcebergCommitCatalog, IcebergCommitInput, IcebergCommitResult, IcebergDeleteFile, IcebergDeletionVector, IcebergEnginePlan, IcebergEngineTable, IcebergEqualityDelete, IcebergField, IcebergGlueCatalogOptions, IcebergLoadTableOptions, IcebergNessieCatalogOptions, IcebergParquetDeleteFile, IcebergParquetDeleteFileContent, IcebergPartitionField, IcebergPartitionSpec, IcebergPlan, IcebergPositionDelete, IcebergReadMode, IcebergRestAccessDelegation, IcebergRestCatalog, IcebergRestCatalogConfig, IcebergRestCatalogOptions, IcebergRestLoadContext, IcebergRestLoadTableOptions, IcebergRestLoadTableResult, IcebergRestStorageCredential, IcebergRowBatch, IcebergSortOrder, IcebergTable, IcebergTableIdentifier, IcebergUnsupportedCatalog, IdGenerator, InExpr, InMemoryLakeOptions, InMemoryRowsScanner, InMemoryRowsStore, InMemoryTableOptions, IndexPruneResult, IndexValue, InsertValidationRules, JoinKey, JoinType, JsonExpr, JsonOrderByTerm, JsonQueryV1, Lake, LakeConfig, LakeqlError, LakeqlErrorCode, LikeExpr, ListOptions, LiteralExpr, LoadIcebergEngineTableOptions, LoadIcebergTableFromObjectStoreOptions, LoadIcebergTableFromRestOptions, LoadIcebergTableOptions, LoadParquetEngineTableOptions, LoadTableOptions, LockAdapter, LogHook, LogicalExpr, LookupJoinFunction, LookupJoinOptions, Manifest, ManifestDeleteFile, ManifestFile, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, MemorySpillAdapterOptions, MetadataFile, MetricsHook, MinMaxColumnIndex, NotExpr, NullCheckExpr, ObjectHead, ObjectInfo, ObjectStoreCacheOptions, ObjectStoreIcebergCommitCatalog, ObjectStoreJsonCache, ObjectStoreJsonCacheOptions, ObjectStoreReadControls, ObjectStoreUriAuthority, OperatorSnapshotValue, OrderByTerm, OutputManifest, OutputManifestEntry, PACKAGE, ParquetColumnBatch, ParquetEnginePlan, ParquetEngineTable, ParquetLakeConfig, ParquetMetadata, ParquetRowBatch, ParquetRowGroupPlan, ParquetScanAdapter, PartitionedParquetOutputEntryOptions, PathQueryInit, PlanIcebergFilesOptions, PlanParquetRowGroupsOptions, PlanParquetTaskWorkUnitsOptions, PlannedIcebergFile, PlannedParquetRowGroup, PredicatePlan, PredicatePlanOptions, ProjectIcebergRowOptions, PutOptions, QueryBudget, QueryBuilder, QueryPolicy, QueryPolicyContext, QueryResult, QueryRunOptions, QueryStats, QueueAdapter, ReadParquetBatchOptions, ReadParquetOptions, ResumableBatchOptions, ResumedQuery, Row, RuntimeSubstrate, Scalar, ScanAdapter, ScanBatch, ScanColumnBatch, ScanEngineOptions, ScanOptions, ScanParquetTaskOptions, ScanPlannedIcebergRowsOptions, ScanTaskPlan, ScanTaskPlanOptions, ScanVectorBatch, Selection, SharedCacheEntry, SharedCacheSetOptions, SharedMemoryCache, SidecarFileIndex, SliceOptions, SliceResult, Snapshot, SortOperatorState, SortOptions, SortResult, SortRunState, SpillAdapter, SpillRef, SpillUsage, SqlBoolean, TaskCheckpoint, TaskInput, TaskManifest, TaskManifestTask, TaskState, TaskTransitionInput, TimestampUnit, TimestampValue, TopKOperatorState, TopKOptions, TopKResult, ValueInput, Vector, VectorAggregateOptions, VectorAggregateSnapshotValue, VectorAggregateState, VectorAggregateStateSnapshot, VectorAggregateStateSnapshots, VectorAggregateStates, VectorAggregateValue, VectorGroup, VectorGroupByGroupSnapshot, VectorGroupByOptions, VectorGroupBySnapshotValue, VectorGroupByState, VectorGroupByStateSnapshot, VectorHashJoinOptions, VectorProjectionSpec, VectorTopKOptions, WorkUnitFanInOptions, WriteParquetOptions, WriteParquetRowsOptions, WritePartitionedParquetFile, WritePartitionedParquetResult, WritePartitionedParquetTaskOptions, WritePartitionedParquetTaskResult, add, advanceTaskCheckpoint, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, applyIcebergDeletes, assertBookmarkMatches, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxIntersects, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, compareTimestampValues, concatBatches, createBookmark, createInMemoryLake, createLake, createOutputManifest, createOutputManifestFromCheckpoints, createLake as createParquetLake, createParquetTableAs, createTaskManifest, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, div, encodeJsonLine, enforceVectorGroupByBudget, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, eq, evaluate, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fingerprint, fn, gatherBatch, getOrCreateVectorGroup, gt, gte, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, ilike, inMemoryRowsScanner, isIn, isLakeqlError, isNotNull, isNull, isTimestampValue, jsonSafeValue, jsonWorkUnitBoundary, like, lit, loadGeoBackend, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, lookupJoin, lt, lte, matches, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memoryCheckpointAdapter, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, objectStoreJsonCache, or, parquetScanner, parseGeometry, parseHivePartitions, parseJsonQuery, partitionedParquetOutputEntries, planFiles, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readOutputManifest, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, requireGeoBackend, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanBatches, scanParquetTaskBatches, scanParquetTaskColumnBatches, scanPlannedIcebergRows, scanRows, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, setGeoBackend, signPaginationToken, snapshotVectorAggregateStates, snapshotVectorGroupByState, stableStringify, sub, throwIfAborted, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry, transitionTaskCheckpoint, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, uriObjectStore, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorHashJoin, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, verifyPaginationToken, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './index.js';
2
+ export { AggregateExpr, AggregateGroupSnapshot, AggregateOp, AggregateOperatorState, AggregateOptions, AggregateParquetGroupTaskOptions, AggregateParquetGroupTasksOptions, AggregateParquetTaskOptions, AggregateParquetTasksOptions, AggregateResult, AggregateSnapshotValue, AggregateSpec, AggregateStateSnapshot, AggregationBuilder, ApplyIcebergDeletesOptions, ArithmeticExpr, BBox, BBoxIndex, Batch, BatchExprValues, BetweenExpr, Bookmark, BookmarkInit, BookmarkPosition, BookmarkQuery, BroadcastJoinOptions, CacheApiCache, CacheApiCacheOptions, CacheEntry, CachePolicy, CallExpr, CaseExpr, CaseWhenExpr, CheckpointAdapter, CheckpointStore, Clock, ColumnExpr, ColumnInput, CompareExpr, CompareOp, CompatibleWindowSortGroup, CompatibleWindowSortItem, ConditionalObjectStore, ConditionalPutOptions, CreateParquetTableAsOptions, CreateParquetTableAsQuery, CreateParquetTableAsResult, CsvStreamOptions, DecodedIcebergDeletes, DecodedIcebergParquetDeletes, ERROR_CODES, EngineFilePlan, EngineTable, ErrorDetails, ExplainJson, ExplainResult, Expr, GeoBackend, GeoJsonGeometry, IcebergAppendFile, IcebergAppendOptions, IcebergAppendOutputManifestOptions, IcebergAppendResult, IcebergCatalog, IcebergCommitCatalog, IcebergCommitInput, IcebergCommitResult, IcebergDeleteFile, IcebergDeletionVector, IcebergEnginePlan, IcebergEngineTable, IcebergEqualityDelete, IcebergField, IcebergGlueCatalogOptions, IcebergLoadTableOptions, IcebergNessieCatalogOptions, IcebergParquetDeleteFile, IcebergParquetDeleteFileContent, IcebergPartitionField, IcebergPartitionSpec, IcebergPlan, IcebergPositionDelete, IcebergReadMode, IcebergRestAccessDelegation, IcebergRestCatalog, IcebergRestCatalogConfig, IcebergRestCatalogOptions, IcebergRestLoadContext, IcebergRestLoadTableOptions, IcebergRestLoadTableResult, IcebergRestStorageCredential, IcebergRowBatch, IcebergSortOrder, IcebergTable, IcebergTableIdentifier, IcebergUnsupportedCatalog, IdGenerator, InExpr, InMemoryLakeOptions, InMemoryRowsScanner, InMemoryRowsStore, InMemoryTableOptions, IndexPruneResult, IndexValue, InsertValidationRules, IntervalValue, JoinKey, JoinType, JsonExpr, JsonOrderByTerm, JsonQueryV1, Lake, LakeConfig, LakeqlError, LakeqlErrorCode, LikeExpr, ListOptions, LiteralExpr, LoadIcebergEngineTableOptions, LoadIcebergTableFromObjectStoreOptions, LoadIcebergTableFromRestOptions, LoadIcebergTableOptions, LoadParquetEngineTableOptions, LoadTableOptions, LockAdapter, LogHook, LogicalExpr, LookupJoinFunction, LookupJoinOptions, Manifest, ManifestDeleteFile, ManifestFile, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, MemorySpillAdapterOptions, MetadataFile, MetricsHook, MinMaxColumnIndex, NotExpr, NullCheckExpr, ObjectHead, ObjectInfo, ObjectStoreCacheOptions, ObjectStoreIcebergCommitCatalog, ObjectStoreJsonCache, ObjectStoreJsonCacheOptions, ObjectStoreReadControls, ObjectStoreUriAuthority, OperatorSnapshotValue, OrderByTerm, OutputManifest, OutputManifestEntry, PACKAGE, ParquetColumnBatch, ParquetEnginePlan, ParquetEngineTable, ParquetLakeConfig, ParquetMetadata, ParquetRowBatch, ParquetRowGroupPlan, ParquetScanAdapter, PartitionedParquetOutputEntryOptions, PathQueryInit, PlanIcebergFilesOptions, PlanParquetRowGroupsOptions, PlanParquetTaskWorkUnitsOptions, PlannedIcebergFile, PlannedParquetRowGroup, PredicatePlan, PredicatePlanOptions, ProjectIcebergRowOptions, PutOptions, QueryBudget, QueryBuilder, QueryPolicy, QueryPolicyContext, QueryResult, QueryRunOptions, QueryStats, QueueAdapter, ReadParquetBatchOptions, ReadParquetOptions, ResumableBatchOptions, ResumedQuery, Row, RuntimeSubstrate, Scalar, ScanAdapter, ScanBatch, ScanColumnBatch, ScanEngineOptions, ScanObjectPlanOptions, ScanOptions, ScanParquetTaskOptions, ScanPlannedIcebergRowsOptions, ScanTaskPlan, ScanTaskPlanOptions, ScanVectorBatch, Selection, SharedCacheEntry, SharedCacheSetOptions, SharedMemoryCache, SidecarFileIndex, SliceOptions, SliceResult, Snapshot, SortOperatorState, SortOptions, SortResult, SortRunState, SpillAdapter, SpillRef, SpillUsage, SqlBoolean, SqlCsvOptions, SqlLake, SqlQueryOptions, SqlQueryResult, TaskCheckpoint, TaskInput, TaskManifest, TaskManifestTask, TaskState, TaskTransitionInput, TimestampUnit, TimestampValue, TopKOperatorState, TopKOptions, TopKResult, ValueInput, Vector, VectorAggregateOptions, VectorAggregateSnapshotValue, VectorAggregateState, VectorAggregateStateSnapshot, VectorAggregateStateSnapshots, VectorAggregateStates, VectorAggregateValue, VectorGroup, VectorGroupByGroupSnapshot, VectorGroupByOptions, VectorGroupBySnapshotValue, VectorGroupByState, VectorGroupByStateSnapshot, VectorHashJoinOptions, VectorProjectionSpec, VectorTopKOptions, WindowExecutionMode, WindowExplainPlan, WindowExpr, WindowFn, WindowFrame, WindowFrameBound, WindowOperatorState, WindowOptions, WindowOrderTerm, WindowParquetTasksOptions, WindowRankingFn, WindowReadColumnInput, WindowResult, WindowRunState, WindowSnapshotValue, WindowSpec, WindowTaskExecutionOptions, WindowTaskPlan, WindowValueFn, WindowWorkUnitBucket, WindowWorkUnitEvaluationOptions, WindowWorkUnitOrdinal, WindowWorkUnitPartial, WindowWorkUnitRow, WorkUnitFanInOptions, WriteParquetOptions, WriteParquetRowsOptions, WritePartitionedParquetFile, WritePartitionedParquetResult, WritePartitionedParquetTaskOptions, WritePartitionedParquetTaskResult, add, advanceTaskCheckpoint, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, applyIcebergDeletes, applyIntervalToTimestamp, assertBookmarkMatches, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxDistance, bboxIntersects, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, collectExprColumns, collectWindowColumns, compareTimestampValues, compatibleWindowSortGroups, concatBatches, createBookmark, createInMemoryLake, createLake, createOutputManifest, createOutputManifestFromCheckpoints, createParquetLake, createParquetTableAs, createTaskManifest, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, deserializeWindowOperatorState, div, encodeJsonLine, enforceVectorGroupByBudget, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, eq, evaluate, evaluateWindowWorkUnitPartials, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fingerprint, fn, gatherBatch, geometryDistance, getOrCreateVectorGroup, gt, gte, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, ilike, inMemoryRowsScanner, intervalToString, intervalValue, isIn, isIntervalValue, isLakeqlError, isNonNegativeInterval, isNotNull, isNull, isPrototypeMutationKey, isTimestampValue, jsonSafeValue, jsonWorkUnitBoundary, like, lit, loadGeoBackend, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, lookupJoin, lt, lte, matches, materializeBatchRow, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memoryCheckpointAdapter, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, objectStoreJsonCache, or, parquetScanner, parseGeometry, parseHivePartitions, parseJsonQuery, partitionWindowWorkUnitRows, partitionedParquetOutputEntries, planFiles, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, querySql, readControlSignal, readIcebergParquetDeletes, readOutputManifest, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, requireGeoBackend, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanBatches, scanParquetTaskBatches, scanParquetTaskColumnBatches, scanPlannedIcebergRows, scanRows, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, serializeWindowOperatorState, setGeoBackend, signPaginationToken, snapshotVectorAggregateStates, snapshotVectorGroupByState, stableStringify, sub, throwIfAborted, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry, transitionTaskCheckpoint, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, uriObjectStore, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorHashJoin, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, verifyPaginationToken, windowExpressions, windowOperatorState, windowOperatorStateFromRuns, windowParquetTask, windowParquetTasks, windowPartitionBucket, windowReadColumns, windowRowsFromState, windowSortGroupCount, windowSortSpecsCompatible, windowTaskPlanForWindows, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './index.js';
3
3
  import 'hyparquet-writer';
4
4
  import 'hyparquet';
5
5
 
@@ -1,7 +1,8 @@
1
- export { IcebergRestCatalog, IcebergTable, IcebergUnsupportedCatalog, InMemoryRowsScanner, InMemoryRowsStore, ObjectStoreIcebergCommitCatalog, ObjectStoreJsonCache, PACKAGE, applyIcebergDeletes, createInMemoryLake, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, inMemoryRowsScanner, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, objectStoreJsonCache, planFiles, scanBatches, scanPlannedIcebergRows, scanRows, vectorHashJoin } from './chunk-5K5JMJ2M.js';
2
- export { AggregationBuilder, CacheApiCache, Lake, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, ParquetScanAdapter, QueryBuilder, QueryResult, ResumedQuery, SharedMemoryCache, add, advanceTaskCheckpoint, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, assertBookmarkMatches, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, concatBatches, createBookmark, createParquetLake as createLake, createOutputManifest, createOutputManifestFromCheckpoints, createParquetLake, createParquetTableAs, createTaskManifest, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, div, enforceVectorGroupByBudget, eq, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fingerprint, fn, gatherBatch, getOrCreateVectorGroup, gt, gte, ilike, isIn, isNotNull, isNull, jsonWorkUnitBoundary, like, lit, lookupJoin, lt, lte, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memoryCheckpointAdapter, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, or, parquetScanner, parseHivePartitions, parseJsonQuery, partitionedParquetOutputEntries, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readOutputManifest, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanParquetTaskBatches, scanParquetTaskColumnBatches, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, signPaginationToken, snapshotVectorAggregateStates, snapshotVectorGroupByState, stableStringify, sub, throwIfAborted, transitionTaskCheckpoint, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, uriObjectStore, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, verifyPaginationToken, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './chunk-MXGEAVHL.js';
3
- import { LakeqlError } from './chunk-TFD5RFKB.js';
4
- export { ERROR_CODES, LakeqlError, TimestampValue, bboxIntersects, compareTimestampValues, encodeJsonLine, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, evaluate, isLakeqlError, isTimestampValue, jsonSafeValue, loadGeoBackend, matches, parseGeometry, requireGeoBackend, setGeoBackend, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry } from './chunk-TFD5RFKB.js';
1
+ export { IcebergRestCatalog, IcebergTable, IcebergUnsupportedCatalog, InMemoryRowsScanner, InMemoryRowsStore, ObjectStoreIcebergCommitCatalog, ObjectStoreJsonCache, PACKAGE, SqlQueryResult, applyIcebergDeletes, createInMemoryLake, createLake, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, inMemoryRowsScanner, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, objectStoreJsonCache, planFiles, querySql, scanBatches, scanPlannedIcebergRows, scanRows, vectorHashJoin } from './chunk-3WUY56UD.js';
2
+ export { AggregationBuilder, CacheApiCache, Lake, MemoryCache, MemoryObjectStore, MemorySpillAdapter, ParquetScanAdapter, QueryBuilder, QueryResult, ResumedQuery, SharedMemoryCache, add, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, concatBatches, createParquetLake, createParquetTableAs, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, deserializeWindowOperatorState, div, enforceVectorGroupByBudget, eq, evaluateWindowWorkUnitPartials, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fn, gatherBatch, getOrCreateVectorGroup, gt, gte, ilike, isIn, isNotNull, isNull, jsonWorkUnitBoundary, like, lit, lookupJoin, lt, lte, materializeBatchRow, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, or, parquetScanner, parseHivePartitions, parseJsonQuery, partitionWindowWorkUnitRows, partitionedParquetOutputEntries, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanParquetTaskBatches, scanParquetTaskColumnBatches, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, serializeWindowOperatorState, snapshotVectorAggregateStates, snapshotVectorGroupByState, sub, throwIfAborted, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, uriObjectStore, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, windowOperatorState, windowOperatorStateFromRuns, windowParquetTask, windowParquetTasks, windowPartitionBucket, windowRowsFromState, withObjectStoreReadControls, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './chunk-32PE6IK4.js';
3
+ export { MemoryCheckpointAdapter, advanceTaskCheckpoint, assertBookmarkMatches, collectExprColumns, collectWindowColumns, compatibleWindowSortGroups, createBookmark, createOutputManifest, createOutputManifestFromCheckpoints, createTaskManifest, fingerprint, isPrototypeMutationKey, memoryCheckpointAdapter, readOutputManifest, signPaginationToken, stableStringify, transitionTaskCheckpoint, verifyPaginationToken, windowExpressions, windowReadColumns, windowSortGroupCount, windowSortSpecsCompatible, windowTaskPlanForWindows, writeOutputManifest } from './chunk-LWF5FKHB.js';
4
+ import { LakeqlError } from './chunk-WGHR35QU.js';
5
+ export { ERROR_CODES, LakeqlError, TimestampValue, applyIntervalToTimestamp, bboxDistance, bboxIntersects, compareTimestampValues, encodeJsonLine, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, evaluate, geometryDistance, intervalToString, intervalValue, isIntervalValue, isLakeqlError, isNonNegativeInterval, isTimestampValue, jsonSafeValue, loadGeoBackend, matches, parseGeometry, requireGeoBackend, setGeoBackend, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry } from './chunk-WGHR35QU.js';
5
6
 
6
7
  // ../r2/dist/index.js
7
8
  function r2Store(bucket) {
@@ -1,4 +1,4 @@
1
- import { setGeoBackend } from './chunk-TFD5RFKB.js';
1
+ import { setGeoBackend } from './chunk-WGHR35QU.js';
2
2
  import { booleanContains } from '@turf/boolean-contains';
3
3
  import { booleanIntersects } from '@turf/boolean-intersects';
4
4
  import { latLngToCell, isValidCell, gridDisk, cellToParent } from 'h3-js';