@query-farm/vgi 0.49.0 → 0.49.2

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.
@@ -1,6 +1,7 @@
1
1
  import { CatalogInterface, type AttachOpaqueData, type TransactionOpaqueData, type CatalogAttachResult, type SchemaInfo, type CatalogInfo, type TableInfo, type ViewInfo, type FunctionInfo, type MacroInfo, type IndexInfo, type CopyFromFormatInfo, type ScanFunctionResultRecord } from "./interface.js";
2
2
  import { type CatalogDescriptor } from "./descriptors.js";
3
3
  import type { FunctionRegistry } from "../functions/registry.js";
4
+ type Awaitable<T> = T | Promise<T>;
4
5
  import { type AttachOptionSpec } from "./attach-option.js";
5
6
  import type { CatalogCapabilities } from "../generated/vgi-protocol-types.js";
6
7
  /**
@@ -112,15 +113,15 @@ export declare class ReadOnlyCatalogInterface extends CatalogInterface {
112
113
  */
113
114
  protected itemAttachId(attachOpaqueData: AttachOpaqueData): AttachOpaqueData;
114
115
  catalogContentsCacheable(): boolean;
115
- schemas(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): SchemaInfo[];
116
+ schemas(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): Awaitable<SchemaInfo[]>;
116
117
  private _estimatedObjectCount;
117
- schemaGet(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): SchemaInfo | null;
118
+ schemaGet(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<SchemaInfo | null>;
118
119
  schemaContentsTables(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Promise<TableInfo[]>;
119
120
  tableColumnStatisticsGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): {
120
121
  bytes: Uint8Array;
121
122
  cacheMaxAgeSeconds: number | null;
122
123
  } | null;
123
- schemaContentsViews(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): ViewInfo[];
124
+ schemaContentsViews(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<ViewInfo[]>;
124
125
  schemaContentsFunctions(attachOpaqueData: AttachOpaqueData, path: string[], type: string, transactionOpaqueData?: TransactionOpaqueData): FunctionInfo[];
125
126
  /**
126
127
  * The frozen FunctionInfo for `f` as declared in `schema`, built on first use.
@@ -158,6 +159,7 @@ export declare class ReadOnlyCatalogInterface extends CatalogInterface {
158
159
  tableUpdateFunctionGet(_attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, _transactionOpaqueData?: TransactionOpaqueData): ScanFunctionResultRecord;
159
160
  tableDeleteFunctionGet(_attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, _transactionOpaqueData?: TransactionOpaqueData): ScanFunctionResultRecord;
160
161
  tableGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Promise<TableInfo | null>;
161
- viewGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): ViewInfo | null;
162
+ viewGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<ViewInfo | null>;
162
163
  copyFromFormats(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): CopyFromFormatInfo[];
163
164
  }
165
+ export {};
package/dist/index.js CHANGED
@@ -4262,16 +4262,18 @@ class WkbBoundsReader {
4262
4262
  this.offset += 8;
4263
4263
  return value;
4264
4264
  }
4265
- point(littleEndian, dimensions) {
4265
+ point(littleEndian, dimensions, isPointGeometry = false) {
4266
4266
  const x = this.float64(littleEndian);
4267
4267
  const y = this.float64(littleEndian);
4268
- for (let dimension = 2;dimension < dimensions; dimension++)
4269
- this.float64(littleEndian);
4270
- if (Number.isNaN(x) && Number.isNaN(y))
4268
+ let allNaN = Number.isNaN(x) && Number.isNaN(y);
4269
+ for (let dimension = 2;dimension < dimensions; dimension++) {
4270
+ allNaN = Number.isNaN(this.float64(littleEndian)) && allNaN;
4271
+ }
4272
+ if (isPointGeometry && allNaN)
4271
4273
  return null;
4272
- if (!Number.isFinite(x) || !Number.isFinite(y))
4273
- throw new FilterV2Error("WKB coordinate must be finite");
4274
- return { minX: x, minY: y, maxX: x, maxY: y };
4274
+ const [minX, maxX] = Number.isNaN(x) ? [-Infinity, Infinity] : [x, x];
4275
+ const [minY, maxY] = Number.isNaN(y) ? [-Infinity, Infinity] : [y, y];
4276
+ return { minX, minY, maxX, maxY };
4275
4277
  }
4276
4278
  count(littleEndian) {
4277
4279
  const count = this.uint32(littleEndian);
@@ -4323,7 +4325,7 @@ class WkbBoundsReader {
4323
4325
  if (hasSrid)
4324
4326
  this.uint32(littleEndian);
4325
4327
  if (type === 1)
4326
- return this.point(littleEndian, dimensions);
4328
+ return this.point(littleEndian, dimensions, true);
4327
4329
  if (type === 2)
4328
4330
  return this.points(littleEndian, dimensions);
4329
4331
  if (type === 3) {
@@ -4538,14 +4540,16 @@ class PushdownFilters {
4538
4540
  for (const predicate of this.predicates) {
4539
4541
  if (predicate.expression.node === "runtime_filter" && !predicate.expression.supported)
4540
4542
  continue;
4541
- let values;
4542
- try {
4543
- values = Array.from({ length: batch.numRows }, (_, row) => evaluateExpression(predicate.expression, batch, row, this.evaluationContext));
4544
- } catch (error) {
4545
- if (predicate.mode === "advisory")
4546
- continue;
4547
- throw error;
4548
- }
4543
+ const advisory = predicate.mode === "advisory";
4544
+ const values = Array.from({ length: batch.numRows }, (_, row) => {
4545
+ try {
4546
+ return evaluateExpression(predicate.expression, batch, row, this.evaluationContext);
4547
+ } catch (error) {
4548
+ if (advisory)
4549
+ return true;
4550
+ throw error;
4551
+ }
4552
+ });
4549
4553
  for (let row = 0;row < batch.numRows; row++)
4550
4554
  mask[row] &= values[row] === true ? 1 : 0;
4551
4555
  }
@@ -13427,8 +13431,8 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
13427
13431
  const tables = await this.schemaContentsTables(attachOpaqueData, schemaPath, transactionOpaqueData);
13428
13432
  return tables.find((t) => t.name === name) ?? null;
13429
13433
  }
13430
- viewGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
13431
- const views = this.schemaContentsViews(attachOpaqueData, schemaPath, transactionOpaqueData);
13434
+ async viewGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
13435
+ const views = await this.schemaContentsViews(attachOpaqueData, schemaPath, transactionOpaqueData);
13432
13436
  return views.find((v) => v.name === name) ?? null;
13433
13437
  }
13434
13438
  copyFromFormats(attachOpaqueData, transactionOpaqueData) {
@@ -20719,4 +20723,4 @@ export {
20719
20723
  writeRowsBatch
20720
20724
  };
20721
20725
 
20722
- //# debugId=3EFA2D875F0253C364756E2164756E21
20726
+ //# debugId=D575CDBB8B409C9B64756E2164756E21