@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.
@@ -2780,16 +2780,18 @@ class WkbBoundsReader {
2780
2780
  this.offset += 8;
2781
2781
  return value;
2782
2782
  }
2783
- point(littleEndian, dimensions) {
2783
+ point(littleEndian, dimensions, isPointGeometry = false) {
2784
2784
  const x = this.float64(littleEndian);
2785
2785
  const y = this.float64(littleEndian);
2786
- for (let dimension = 2;dimension < dimensions; dimension++)
2787
- this.float64(littleEndian);
2788
- if (Number.isNaN(x) && Number.isNaN(y))
2786
+ let allNaN = Number.isNaN(x) && Number.isNaN(y);
2787
+ for (let dimension = 2;dimension < dimensions; dimension++) {
2788
+ allNaN = Number.isNaN(this.float64(littleEndian)) && allNaN;
2789
+ }
2790
+ if (isPointGeometry && allNaN)
2789
2791
  return null;
2790
- if (!Number.isFinite(x) || !Number.isFinite(y))
2791
- throw new FilterV2Error("WKB coordinate must be finite");
2792
- return { minX: x, minY: y, maxX: x, maxY: y };
2792
+ const [minX, maxX] = Number.isNaN(x) ? [-Infinity, Infinity] : [x, x];
2793
+ const [minY, maxY] = Number.isNaN(y) ? [-Infinity, Infinity] : [y, y];
2794
+ return { minX, minY, maxX, maxY };
2793
2795
  }
2794
2796
  count(littleEndian) {
2795
2797
  const count = this.uint32(littleEndian);
@@ -2841,7 +2843,7 @@ class WkbBoundsReader {
2841
2843
  if (hasSrid)
2842
2844
  this.uint32(littleEndian);
2843
2845
  if (type === 1)
2844
- return this.point(littleEndian, dimensions);
2846
+ return this.point(littleEndian, dimensions, true);
2845
2847
  if (type === 2)
2846
2848
  return this.points(littleEndian, dimensions);
2847
2849
  if (type === 3) {
@@ -3056,14 +3058,16 @@ class PushdownFilters {
3056
3058
  for (const predicate of this.predicates) {
3057
3059
  if (predicate.expression.node === "runtime_filter" && !predicate.expression.supported)
3058
3060
  continue;
3059
- let values;
3060
- try {
3061
- values = Array.from({ length: batch.numRows }, (_, row) => evaluateExpression(predicate.expression, batch, row, this.evaluationContext));
3062
- } catch (error) {
3063
- if (predicate.mode === "advisory")
3064
- continue;
3065
- throw error;
3066
- }
3061
+ const advisory = predicate.mode === "advisory";
3062
+ const values = Array.from({ length: batch.numRows }, (_, row) => {
3063
+ try {
3064
+ return evaluateExpression(predicate.expression, batch, row, this.evaluationContext);
3065
+ } catch (error) {
3066
+ if (advisory)
3067
+ return true;
3068
+ throw error;
3069
+ }
3070
+ });
3067
3071
  for (let row = 0;row < batch.numRows; row++)
3068
3072
  mask[row] &= values[row] === true ? 1 : 0;
3069
3073
  }
@@ -16837,8 +16841,8 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
16837
16841
  const tables = await this.schemaContentsTables(attachOpaqueData, schemaPath, transactionOpaqueData);
16838
16842
  return tables.find((t) => t.name === name) ?? null;
16839
16843
  }
16840
- viewGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
16841
- const views = this.schemaContentsViews(attachOpaqueData, schemaPath, transactionOpaqueData);
16844
+ async viewGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
16845
+ const views = await this.schemaContentsViews(attachOpaqueData, schemaPath, transactionOpaqueData);
16842
16846
  return views.find((v) => v.name === name) ?? null;
16843
16847
  }
16844
16848
  copyFromFormats(attachOpaqueData, transactionOpaqueData) {
@@ -17880,4 +17884,4 @@ export {
17880
17884
  validateTableConstraints
17881
17885
  };
17882
17886
 
17883
- //# debugId=A2EDD9D8BB9FFE7F64756E2164756E21
17887
+ //# debugId=8D435BE08315C5EF64756E2164756E21