@query-farm/vgi 0.48.5 → 0.48.7

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
  }
@@ -13171,8 +13175,8 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
13171
13175
  const tables = await this.schemaContentsTables(attachOpaqueData, schemaPath, transactionOpaqueData);
13172
13176
  return tables.find((t) => t.name === name) ?? null;
13173
13177
  }
13174
- viewGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
13175
- const views = this.schemaContentsViews(attachOpaqueData, schemaPath, transactionOpaqueData);
13178
+ async viewGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
13179
+ const views = await this.schemaContentsViews(attachOpaqueData, schemaPath, transactionOpaqueData);
13176
13180
  return views.find((v) => v.name === name) ?? null;
13177
13181
  }
13178
13182
  copyFromFormats(attachOpaqueData, transactionOpaqueData) {
@@ -20436,4 +20440,4 @@ export {
20436
20440
  writeRowsBatch
20437
20441
  };
20438
20442
 
20439
- //# debugId=4A8CA3311D81DEBB64756E2164756E21
20443
+ //# debugId=09675D2414321AE464756E2164756E21