@loaders.gl/core 5.0.1 → 5.0.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.
Files changed (47) hide show
  1. package/dist/api.cjs +1 -1
  2. package/dist/dist.dev.js +3 -3
  3. package/dist/dist.min.js +1 -1
  4. package/dist/index.cjs +1 -1
  5. package/dist/lib/init.js +1 -1
  6. package/dist/loader-utils/index.cjs +29 -2
  7. package/dist/loader-utils/index.cjs.map +2 -2
  8. package/dist/loader-utils/index.d.ts +2 -1
  9. package/dist/loader-utils/index.d.ts.map +1 -1
  10. package/dist/loader-utils/index.js +1 -0
  11. package/dist/loader-utils/index.js.map +1 -1
  12. package/dist/loader-utils/json-loader-metadata.cjs +1 -1
  13. package/dist/loader-utils/json-loader-metadata.js +1 -1
  14. package/dist/loader-utils/json-loader.cjs +1 -1
  15. package/dist/loader-utils/lib/log-utils/log.js +1 -1
  16. package/dist/loader-utils/lib/sources/raster-source.d.ts +17 -1
  17. package/dist/loader-utils/lib/sources/raster-source.d.ts.map +1 -1
  18. package/dist/loader-utils/lib/sources/raster-source.js.map +1 -1
  19. package/dist/loader-utils/lib/sources/raster-tile.d.ts +7 -0
  20. package/dist/loader-utils/lib/sources/raster-tile.d.ts.map +1 -0
  21. package/dist/loader-utils/lib/sources/raster-tile.js +34 -0
  22. package/dist/loader-utils/lib/sources/raster-tile.js.map +1 -0
  23. package/dist/null-loader-metadata.cjs +1 -1
  24. package/dist/null-loader-metadata.js +1 -1
  25. package/dist/null-loader.cjs +1 -1
  26. package/dist/null-worker-node.js +1 -1
  27. package/dist/null-worker.js +1 -1
  28. package/dist/scan/arrow-query.cjs +2 -0
  29. package/dist/scan/arrow-query.cjs.map +2 -2
  30. package/dist/scan/arrow-query.d.ts +1 -1
  31. package/dist/scan/arrow-query.d.ts.map +1 -1
  32. package/dist/scan/arrow-query.js +1 -1
  33. package/dist/scan/arrow-query.js.map +1 -1
  34. package/dist/scan/index.cjs +0 -18
  35. package/dist/scan/index.cjs.map +2 -2
  36. package/dist/scan/index.d.ts +2 -5
  37. package/dist/scan/index.d.ts.map +1 -1
  38. package/dist/scan/index.js +0 -4
  39. package/dist/scan/index.js.map +1 -1
  40. package/dist/worker-utils/index.cjs +2 -2
  41. package/dist/worker-utils/lib/env-utils/version.js +1 -1
  42. package/package.json +2 -2
  43. package/src/loader-utils/index.ts +2 -0
  44. package/src/loader-utils/lib/sources/raster-source.ts +18 -1
  45. package/src/loader-utils/lib/sources/raster-tile.ts +46 -0
  46. package/src/scan/arrow-query.ts +1 -1
  47. package/src/scan/index.ts +2 -11
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/scan/index.ts", "../../src/loader-utils/lib/scan-utils/columnar-predicate.ts", "../../src/loader-utils/lib/scan-utils/table-query.ts", "../../src/loader-utils/lib/scan-utils/logical-table-query.ts"],
4
- "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {createScanEngine, registerScanBackend} from './scan-engine';\n// The low-level executor lives in loader-utils so format packages can reuse it without importing\n// this optional module. It is re-exported here as the scan package's common batch adapter.\nexport {\n executeTableScanBatches,\n filterTableBatch,\n projectTableBatch,\n projectTableSchema,\n truncateTableBatch\n} from '@loaders.gl/core/loader-utils';\nexport type {TableScanBatchReader, TableScanBatchOperators} from '@loaders.gl/core/loader-utils';\nexport type {\n ScanBackend,\n ScanBackendLoader,\n ScanBackendName,\n ScanEngine,\n ScanEngineOptions\n} from './scan-engine';\n\n// Re-export the query vocabulary from one optional entry point for applications. Format adapters\n// should continue importing the lightweight contracts from @loaders.gl/core/loader-utils.\nexport {parseSQLPredicate} from './parse-sql-predicate';\nexport type {ArrowQueryOptions} from './query-arrow-table';\nexport type {SQLPredicate} from './sql-predicate-types';\nexport type {\n RelationalAggregate,\n RelationalExpression,\n RelationalOrderKey,\n TableQuery,\n TableReference,\n TableSourceCollection,\n TableSelection,\n TableQueryExecutionOptions,\n TableQueryOptions\n} from '@loaders.gl/core/loader-utils';\n\nexport {\n createScanQueryMetadata,\n intersectPointCloudBounds,\n selectPointCloudScanTiles,\n validatePointCloudQueryOptions\n} from '@loaders.gl/core/loader-utils';\nexport type {\n CreateScanQueryMetadataOptions,\n PointCloudQueryBounds,\n PointCloudQueryCapabilities,\n PointCloudQueryOptions,\n PointCloudScanChildrenLoader,\n PointCloudScanReadOptions,\n PointCloudScanSource,\n PointCloudScanTile,\n RasterQueryCapabilities,\n RasterQueryOptions,\n ScanBounds,\n ScanColumnMetadata,\n ScanColumnRole,\n ScanExecutionMethod,\n TableQueryExecutionSummary,\n TableQueryCompleteCallback,\n TableQueryExecutionStatus,\n TableQuerySourceExecutionSummary,\n ScanExecutionSupport,\n ScanQueryCapabilities,\n ScanQueryMetadata,\n ScanQueryMetadataOptions,\n ScanQueryMetadataProvider,\n ScanRasterLevel,\n ScanSourceStatistics,\n ScanSpatialMetadata,\n TableScanReadOptions,\n TableScanSource\n} from '@loaders.gl/core/loader-utils';\nexport type {ScanQuery} from './scan-query';\n\nexport {\n FEDERATED_TABLE_QUERY_CAPABILITIES,\n FederatedTableScanSource,\n getFederatedTableBatchProvenance\n} from './federated-table-scan-source';\nexport type {\n FederatedTableBatch,\n FederatedTableBatchProvenance,\n FederatedTableScanExplain,\n FederatedTableScanSourceOptions,\n FederatedTableSchemaPolicy,\n FederatedTableSourceEntry,\n FederatedTableSourceExplain\n} from './federated-table-scan-source';\n\nexport {\n AddressedVectorTableScanSource,\n VectorFeatureTableScanSource,\n VectorTileTableScanSource\n} from './vector-table-scan-source';\nexport type {\n VectorFeatureTableScanSourceOptions,\n VectorTableScanSourceOptions,\n VectorTileTableScanSourceOptions\n} from './vector-table-scan-source';\n\nexport {ARROW_TABLE_QUERY_CAPABILITIES, explainArrowTableQuery} from './plan-arrow-table-query';\nexport {queryArrowTable} from './query-arrow-table';\nexport {bindSQLPredicate} from './bind-sql-predicate';\nexport {\n isSQLPredicate,\n SQL_PREDICATE_JSON_SCHEMA,\n validateSQLPredicate\n} from './sql-predicate-schema';\nexport {isSQLPredicateParameter} from './sql-predicate-types';\nexport type {\n BoundSQLPredicate,\n SQLComparisonPredicate,\n SQLInPredicate,\n SQLLogicalPredicate,\n SQLNotPredicate,\n SQLNullPredicate,\n SQLPredicateParameter,\n SQLPredicateParameterValues,\n SQLPredicateParserOptions,\n SQLPredicateProperty,\n SQLPredicateScalar,\n SQLPredicateValue\n} from './sql-predicate-types';\nexport {explainTableQuery, getSQLPredicateColumnNames, planTableQuery} from './table-query';\nexport type {\n TableQueryPlan,\n TableQueryPlanStep,\n TableQueryFilterStep,\n TableQueryLimitStep,\n TableQueryProjectStep,\n TableQueryScanStep\n} from './table-query';\n\nexport {\n normalizeTableQuery,\n planLogicalTableQuery\n} from '../loader-utils/lib/scan-utils/logical-table-query';\nexport type {\n NormalizedTableSelection,\n NormalizedTableQuery,\n LogicalTableQueryProjectStep,\n LogicalTableQueryPlan\n} from '../loader-utils/lib/scan-utils/logical-table-query';\n\nexport {projectArrowTable, filterArrowTable} from './arrow-execution';\nexport type {ArrowFilterOptions} from './arrow-execution';\n\nexport {queryGroupedSQL} from './query-grouped-sql';\nexport {preloadQuery, query, queryInBatches, queryProgressive} from './query';\nexport type {\n ProgressiveAggregate,\n ProgressiveAggregateQuery,\n ProgressiveQueryOptions,\n ProgressiveQuerySnapshot\n} from './query-progressive';\nexport type {\n Query,\n QueryOptions,\n SQLQueryParser,\n TypedTableQuery,\n TypedColumnSelection,\n TypedColumnType\n} from './query';\n\nexport {createQueryMetadata} from '@loaders.gl/core/loader-utils';\nexport type {\n CreateQueryMetadataOptions,\n QueryMetadata,\n QueryMetadataOptions,\n QueryCapabilities,\n TableQuerySource,\n TableQueryReadOptions,\n TableQueryPushdownRequest,\n TableQueryPushdownPlan,\n TableQueryCapabilities,\n QueryPushdownCapabilityHints\n} from '@loaders.gl/core/loader-utils';\n\nexport {\n createArrowQueryWorker,\n queryArrowTableInWorker,\n type ArrowQueryWorkerOptions,\n type ArrowQueryWorkerSession\n} from './arrow-query-worker';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n compileColumnarPredicate,\n type ColumnarPredicate,\n type ColumnarPredicateReader\n} from '@math.gl/sql/columnar-predicate';\nimport type {ArrayType} from '@loaders.gl/core/schema';\n\nexport {\n bindColumnarPredicateParameters,\n copyColumnarPredicate,\n getColumnarPredicateColumns,\n getColumnarPredicateParameterNames,\n getColumnarPredicatePath,\n getColumnarPredicatePaths,\n isColumnarPredicateParameter,\n isColumnarPredicateValue,\n validateColumnarPredicate,\n type ColumnarComparisonPredicate,\n type ColumnarInPredicate,\n type ColumnarLogicalPredicate,\n type ColumnarNotPredicate,\n type ColumnarNullPredicate,\n type ColumnarPredicate,\n type ColumnarPredicateInputValue,\n type ColumnarPredicateParameter,\n type ColumnarPredicateParameterValues,\n type ColumnarPredicateProperty,\n type ColumnarPredicateValue,\n type ParameterizedColumnarPredicate\n} from '@math.gl/sql/columnar-predicate';\n\n/** Finds the source rows matching a bound portable predicate. */\nexport function filterColumnarRowIndices(\n predicate: ColumnarPredicate | undefined,\n columns: Record<string, ArrayType>,\n rowCount: number\n): number[] {\n if (!predicate) return Array.from({length: rowCount}, (_, index) => index);\n const evaluate = compileColumnarPredicate(predicate, path => bindColumnarReader(columns, path));\n const result: number[] = [];\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n if (evaluate(rowIndex) === true) result.push(rowIndex);\n }\n return result;\n}\n\n/** Gathers selected rows from format-neutral column arrays. */\nexport function gatherColumnarColumns(\n columns: Record<string, ArrayType>,\n rowIndices: readonly number[],\n selectedColumns?: ReadonlySet<string>\n): Record<string, ArrayType> {\n const result: Record<string, ArrayType> = {};\n for (const [name, column] of Object.entries(columns)) {\n if (!selectedColumns || selectedColumns.has(name)) {\n result[name] = rowIndices.map(rowIndex => (column as ArrayLike<unknown>)[rowIndex]);\n }\n }\n return result;\n}\n\n/** Binds a portable predicate path to one source column. */\nfunction bindColumnarReader(\n columns: Record<string, ArrayType>,\n [name, ...path]: readonly string[]\n): ColumnarPredicateReader {\n const column = columns[name];\n return rowIndex => {\n let value = column?.[rowIndex];\n for (const property of path) {\n if (value == null) return null;\n value = value[property];\n }\n return value as ReturnType<ColumnarPredicateReader>;\n };\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n getColumnarPredicateColumns,\n validateColumnarPredicate,\n type ColumnarPredicate,\n type ColumnarPredicateProperty\n} from './columnar-predicate';\n\n/** One source column selected for logical output, optionally under a new name. */\nexport type TableSelection =\n | string\n | Readonly<{\n /** Source column name, resolved before aliases are applied. */\n column: string;\n /** Output field name. Defaults to the source column name. */\n as?: string;\n }>;\n\n/** Named source, or a named table exposed by a source. Strings are literal names, not dotted paths. */\nexport type TableReference =\n | string\n | Readonly<{\n /** Name of a registered data source. */\n source: string;\n /** Name of a table exposed by that source. */\n table: string;\n }>;\n\n/** Logical query description, independent of cancellation and execution observers. */\nexport type TableQuery<\n PredicateT extends ColumnarPredicate<unknown, ColumnarPredicateProperty> = ColumnarPredicate\n> = Readonly<{\n /** Optional named source or qualified table selected before planning. */\n from?: TableReference;\n /** Output columns in selection order. Omission selects all source columns. */\n select?: readonly TableSelection[];\n /** Predicate evaluated against source columns before output aliases are applied. */\n where?: PredicateT;\n /** Number of filtered rows skipped before applying the limit. */\n offset?: number;\n /** Maximum number of rows retained after filtering and offset. */\n limit?: number;\n}>;\n\n/** Controls one execution without becoming part of the logical query. */\nexport type TableQueryExecutionOptions = Readonly<{\n /** Cooperatively cancels source discovery and execution. */\n signal?: AbortSignal;\n /** Receives one terminal summary, including cancellation, failure, and early termination. */\n onQueryComplete?: import('./scan-query-metadata').TableQueryCompleteCallback;\n}>;\n\n/** Immutable, backend-neutral request for a scan, filter, projection, and limit. */\nexport type TableQueryOptions<\n PredicateT extends ColumnarPredicate<unknown, ColumnarPredicateProperty> = ColumnarPredicate\n> = Pick<TableQueryExecutionOptions, 'signal'> &\n Readonly<{\n /** Portable predicate applied before projection. */\n predicate?: PredicateT;\n /** Output columns in caller-specified order. Defaults to every source column. */\n columns?: readonly string[];\n /** Maximum number of rows retained after filtering and projection. */\n limit?: number;\n }>;\n\n/** Reads the minimum source columns required by the remaining table-query plan. */\nexport type TableQueryScanStep = Readonly<{\n /** Plan discriminator. */\n kind: 'scan';\n /** Source columns required for filtering and output. */\n columns: readonly string[];\n}>;\n\n/** Applies a portable predicate while all predicate columns remain available. */\nexport type TableQueryFilterStep<PredicateT = ColumnarPredicate> = Readonly<{\n /** Plan discriminator. */\n kind: 'filter';\n /** Predicate evaluated using three-valued Boolean semantics. */\n predicate: PredicateT;\n}>;\n\n/** Narrows the result to requested output columns. */\nexport type TableQueryProjectStep = Readonly<{\n /** Plan discriminator. */\n kind: 'project';\n /** Output columns in caller-specified order. */\n columns: readonly string[];\n}>;\n\n/** Retains the first rows in source order after filtering and projection. */\nexport type TableQueryLimitStep = Readonly<{\n /** Plan discriminator. */\n kind: 'limit';\n /** Maximum number of retained rows. */\n limit: number;\n}>;\n\n/** One immutable operation in a normalized table-query plan. */\nexport type TableQueryPlanStep<PredicateT = ColumnarPredicate> =\n | TableQueryScanStep\n | TableQueryFilterStep<PredicateT>\n | TableQueryProjectStep\n | TableQueryLimitStep;\n\n/** Immutable logical query plan shared by CPU, SQL, and GPU backends. */\nexport type TableQueryPlan<PredicateT = ColumnarPredicate> =\n readonly TableQueryPlanStep<PredicateT>[];\n\n/** Capability levels for an individual portable table-query operator. */\nexport type TableQueryOperatorSupport =\n | 'unsupported'\n | 'residual'\n | 'pushdown'\n | 'pushdown+residual';\n\n/** Optimization and correctness capabilities advertised by a table-query backend. */\nexport type TableQueryCapabilities = Readonly<{\n /** Whether output projection can avoid reading unrequested columns. */\n projection: TableQueryOperatorSupport;\n /** Whether predicates are unsupported, residual, pushed down, or both pushed and residual. */\n predicate: TableQueryOperatorSupport;\n /** Whether limits are unsupported, applied after execution, or stop physical work early. */\n limit: TableQueryOperatorSupport;\n /** Whether exact CAST semantics can execute at the source; conversions require negotiation. */\n cast?: TableQueryOperatorSupport;\n /** Whether the source can skip filtered rows before its limit. */\n offset?: TableQueryOperatorSupport;\n /** Whether the backend can stream bounded result batches. */\n streaming: boolean;\n /** Whether active and queued physical work observes cancellation. */\n cancellation: boolean;\n /** Whether scalar expressions can be evaluated before projection. */\n expressions?: TableQueryOperatorSupport;\n /** Whether output rows can be ordered before the global limit. */\n orderBy?: TableQueryOperatorSupport;\n /** Whether grouped aggregate output is supported. */\n aggregates?: TableQueryOperatorSupport;\n}>;\n\n/**\n * Produces the canonical scan, filter, project, and limit sequence for a table query.\n *\n * Predicate columns are retained by the scan even if callers omit them from the output projection.\n * This makes SQL `WHERE` semantics independent of a backend's internal API call order.\n */\nexport function planTableQuery<\n ValueT,\n PropertyT extends ColumnarPredicateProperty,\n PredicateT extends ColumnarPredicate<ValueT, PropertyT>\n>(\n sourceColumnNames: readonly string[],\n options: TableQueryOptions<PredicateT> = {}\n): TableQueryPlan<PredicateT> {\n validateTableQueryOptions(sourceColumnNames, options);\n\n const outputColumnNames = options.columns ? [...options.columns] : [...sourceColumnNames];\n const predicateColumnNames = options.predicate\n ? getColumnarPredicateColumns(options.predicate)\n : [];\n const requiredColumnNames = new Set([...outputColumnNames, ...predicateColumnNames]);\n const scanColumnNames = sourceColumnNames.filter(columnName =>\n requiredColumnNames.has(columnName)\n );\n const steps: TableQueryPlanStep<PredicateT>[] = [\n Object.freeze({kind: 'scan' as const, columns: Object.freeze(scanColumnNames)})\n ];\n\n if (options.predicate) {\n steps.push(Object.freeze({kind: 'filter' as const, predicate: options.predicate}));\n }\n steps.push(Object.freeze({kind: 'project' as const, columns: Object.freeze(outputColumnNames)}));\n if (options.limit !== undefined) {\n steps.push(Object.freeze({kind: 'limit' as const, limit: options.limit}));\n }\n return Object.freeze(steps);\n}\n\n/** Validates a portable table query against the columns exposed by one source. */\nexport function validateTableQueryOptions<\n ValueT,\n PropertyT extends ColumnarPredicateProperty,\n PredicateT extends ColumnarPredicate<ValueT, PropertyT>\n>(sourceColumnNames: readonly string[], options: TableQueryOptions<PredicateT>): void {\n const availableColumnNames = new Set(sourceColumnNames);\n const outputColumnNames = options.columns ?? sourceColumnNames;\n const seenColumnNames = new Set<string>();\n for (const columnName of outputColumnNames) {\n if (!availableColumnNames.has(columnName)) {\n throw new Error(`Table query column not found: ${columnName}`);\n }\n if (seenColumnNames.has(columnName)) {\n throw new Error(`Table query column was selected more than once: ${columnName}`);\n }\n seenColumnNames.add(columnName);\n }\n validateTableQueryLimit(options.limit);\n if (options.predicate) {\n validateColumnarPredicate(options.predicate, availableColumnNames);\n }\n}\n\n/** Validates a portable table-query limit independently of source-schema validation. */\nexport function validateTableQueryLimit(limit: number | undefined): void {\n if (limit !== undefined && (!Number.isSafeInteger(limit) || limit < 0)) {\n throw new Error('Table query limit must be a non-negative safe integer.');\n }\n}\n\n/** Validates a logical row offset before any batches are read. */\nexport function validateTableQueryOffset(offset: number | undefined): void {\n if (offset !== undefined && (!Number.isSafeInteger(offset) || offset < 0)) {\n throw new Error('Table query offset must be a non-negative safe integer.');\n }\n}\n\n/** Static format hints only; omission means unknown and never authorizes execution. */\nexport type QueryPushdownCapabilityHints = Readonly<{\n /** The format may support reading only selected columns. */\n projection?: boolean;\n /** The format may support predicate evaluation or pruning. */\n predicate?: boolean;\n /** An implementation may evaluate some CAST conversions. */\n cast?: boolean;\n /** An implementation may skip rows at the source. */\n offset?: boolean;\n /** An implementation may stop source work after a row limit. */\n limit?: boolean;\n}>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n validateColumnarPredicate,\n type ColumnarPredicate,\n type ColumnarPredicateProperty\n} from './columnar-predicate';\nimport {\n planTableQuery,\n validateTableQueryLimit,\n validateTableQueryOffset,\n type TableQuery,\n type TableReference,\n type TableQueryPlanStep\n} from './table-query';\n\n/** Explicit source-to-output mapping for one selected field. */\nexport type NormalizedTableSelection = Readonly<{\n /** Column read from the source. */\n column: string;\n /** Name of the returned field. */\n as: string;\n}>;\n\n/** Logical query with all output selections expanded into explicit mappings. */\nexport type NormalizedTableQuery<PredicateT = ColumnarPredicate> = Readonly<{\n /** Optional source reference preserved separately from physical scan operations. */\n from?: TableReference;\n /** Output mappings in caller-specified order. */\n select: readonly NormalizedTableSelection[];\n /** Predicate resolved against source names before aliases. */\n where?: PredicateT;\n /** Global number of filtered rows skipped before applying the limit. */\n offset?: number;\n /** Global post-filter row limit. */\n limit?: number;\n}>;\n\n/** Logical projection retaining source names separately from output names. */\nexport type LogicalTableQueryProjectStep = Readonly<{\n /** Plan discriminator. */\n kind: 'project';\n /** Output mappings applied after filtering. */\n select: readonly NormalizedTableSelection[];\n}>;\n\n/** Scan, filter, aliased projection, and limit operations in execution order. */\nexport type LogicalTableQueryPlan<PredicateT = ColumnarPredicate> = readonly (\n | Exclude<TableQueryPlanStep<PredicateT>, {kind: 'project'}>\n | Readonly<{kind: 'offset'; offset: number}>\n | LogicalTableQueryProjectStep\n)[];\n\n/** Validates logical query fields and expands selections without modifying caller input. */\nexport function normalizeTableQuery<\n PredicateT extends ColumnarPredicate<unknown, ColumnarPredicateProperty> = ColumnarPredicate\n>(\n sourceColumnNames: readonly string[],\n query: TableQuery<PredicateT> = {}\n): NormalizedTableQuery<PredicateT> {\n if (!query || typeof query !== 'object' || Array.isArray(query)) {\n throw new Error('Table query must be an object.');\n }\n for (const key of Object.keys(query)) {\n if (!['from', 'select', 'where', 'offset', 'limit'].includes(key)) {\n throw new Error(`Unsupported table query option: ${key}`);\n }\n }\n if (query.select !== undefined && (!Array.isArray(query.select) || query.select.length === 0)) {\n throw new Error('Table query select must be a non-empty array.');\n }\n validateTableReference(query.from);\n validateTableQueryOffset(query.offset);\n validateTableQueryLimit(query.limit);\n if (query.where !== undefined) {\n validateColumnarPredicate(query.where, new Set(sourceColumnNames));\n }\n const outputNames = new Set<string>();\n const select = (query.select ?? sourceColumnNames).map(selection => {\n if (\n typeof selection !== 'string' &&\n (!selection || typeof selection !== 'object' || Array.isArray(selection))\n ) {\n throw new Error('Table query selection must be a column name or {column, as}.');\n }\n if (\n typeof selection !== 'string' &&\n Object.keys(selection).some(key => key !== 'column' && key !== 'as')\n ) {\n throw new Error('Unsupported table query selection field.');\n }\n const column = typeof selection === 'string' ? selection : selection.column;\n const outputName =\n typeof selection === 'string'\n ? selection\n : selection.as === undefined\n ? column\n : selection.as;\n if (typeof column !== 'string' || !sourceColumnNames.includes(column)) {\n throw new Error(`Table query column not found: ${column}`);\n }\n if (typeof outputName !== 'string' || outputName.length === 0) {\n throw new Error('Table query output name must be a non-empty string.');\n }\n if (outputNames.has(outputName)) {\n throw new Error(`Duplicate table query output name: ${outputName}`);\n }\n outputNames.add(outputName);\n return Object.freeze({column, as: outputName});\n });\n // Reuse source-column and predicate validation; aliases never participate in WHERE resolution.\n planTableQuery(sourceColumnNames, {\n columns: [...new Set(select.map(selection => selection.column))],\n predicate: query.where,\n limit: query.limit\n });\n return Object.freeze({\n select: Object.freeze(select),\n ...(query.from === undefined\n ? {}\n : {from: typeof query.from === 'string' ? query.from : Object.freeze({...query.from})}),\n ...(query.where === undefined ? {} : {where: query.where}),\n ...(query.offset === undefined ? {} : {offset: query.offset}),\n ...(query.limit === undefined ? {} : {limit: query.limit})\n });\n}\n\n/** Builds a logical plan using the shared scan planner and an explicit aliased projection. */\nexport function planLogicalTableQuery<\n PredicateT extends ColumnarPredicate<unknown, ColumnarPredicateProperty> = ColumnarPredicate\n>(\n sourceColumnNames: readonly string[],\n query: TableQuery<PredicateT> = {}\n): LogicalTableQueryPlan<PredicateT> {\n const normalized = normalizeTableQuery(sourceColumnNames, query);\n const plan = planTableQuery(sourceColumnNames, {\n columns: [...new Set(normalized.select.map(selection => selection.column))],\n predicate: normalized.where,\n limit: normalized.limit\n });\n const steps: LogicalTableQueryPlan<PredicateT>[number][] = [];\n for (const step of plan) {\n if (step.kind === 'limit' && normalized.offset !== undefined)\n steps.push(Object.freeze({kind: 'offset', offset: normalized.offset}));\n steps.push(\n step.kind === 'project' ? Object.freeze({kind: 'project', select: normalized.select}) : step\n );\n }\n if (normalized.limit === undefined && normalized.offset !== undefined)\n steps.push(Object.freeze({kind: 'offset', offset: normalized.offset}));\n return Object.freeze(steps);\n}\n\n/** Validates identifiers without interpreting dots or rewriting quoted names. */\nexport function validateTableReference(\n reference: unknown\n): asserts reference is TableReference | undefined {\n if (reference === undefined) return;\n if (typeof reference === 'string' && reference.trim()) return;\n if (reference && typeof reference === 'object' && !Array.isArray(reference)) {\n const value = reference as Record<string, unknown>;\n if (\n Object.keys(value).every(key => key === 'source' || key === 'table') &&\n typeof value.source === 'string' &&\n value.source.trim() &&\n typeof value.table === 'string' &&\n value.table.trim()\n )\n return;\n }\n throw new Error('FROM must be a source name or {source, table} with non-empty names.');\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,yBAAoD;AAGpD,0BAMO;AAYP,iCAAgC;AAehC,IAAAA,uBAKO;AAiCP,yCAIO;AAWP,sCAIO;AAOP,oCAAqE;AACrE,+BAA8B;AAC9B,gCAA+B;AAC/B,kCAIO;AACP,iCAAsC;AAetC,IAAAC,sBAA4E;;;AC3H5E,gCAIO;AAGP,IAAAC,6BAsBO;;;ACmHA,SAAS,eAKd,mBACA,UAAyC,CAAC,GACd;AAC5B,4BAA0B,mBAAmB,OAAO;AAEpD,QAAM,oBAAoB,QAAQ,UAAU,CAAC,GAAG,QAAQ,OAAO,IAAI,CAAC,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;",
4
+ "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {createScanEngine, registerScanBackend} from './scan-engine';\n// The low-level executor lives in loader-utils so format packages can reuse it without importing\n// this optional module. It is re-exported here as the scan package's common batch adapter.\nexport {\n executeTableScanBatches,\n filterTableBatch,\n projectTableBatch,\n projectTableSchema,\n truncateTableBatch\n} from '@loaders.gl/core/loader-utils';\nexport type {TableScanBatchReader, TableScanBatchOperators} from '@loaders.gl/core/loader-utils';\nexport type {\n ScanBackend,\n ScanBackendLoader,\n ScanBackendName,\n ScanEngine,\n ScanEngineOptions\n} from './scan-engine';\n\n// Re-export the query vocabulary from one optional entry point for applications. Format adapters\n// should continue importing the lightweight contracts from @loaders.gl/core/loader-utils.\nexport {parseSQLPredicate} from './parse-sql-predicate';\nexport type {ArrowFilterOptions} from './arrow-execution';\nexport type {ArrowQueryOptions} from './query-arrow-table';\nexport type {SQLPredicate} from './sql-predicate-types';\nexport type {\n RelationalAggregate,\n RelationalExpression,\n RelationalOrderKey,\n TableQuery,\n TableReference,\n TableSourceCollection,\n TableSelection,\n TableQueryExecutionOptions,\n TableQueryOptions\n} from '@loaders.gl/core/loader-utils';\n\nexport {\n createScanQueryMetadata,\n intersectPointCloudBounds,\n selectPointCloudScanTiles,\n validatePointCloudQueryOptions\n} from '@loaders.gl/core/loader-utils';\nexport type {\n CreateScanQueryMetadataOptions,\n PointCloudQueryBounds,\n PointCloudQueryCapabilities,\n PointCloudQueryOptions,\n PointCloudScanChildrenLoader,\n PointCloudScanReadOptions,\n PointCloudScanSource,\n PointCloudScanTile,\n RasterQueryCapabilities,\n RasterQueryOptions,\n ScanBounds,\n ScanColumnMetadata,\n ScanColumnRole,\n ScanExecutionMethod,\n TableQueryExecutionSummary,\n TableQueryCompleteCallback,\n TableQueryExecutionStatus,\n TableQuerySourceExecutionSummary,\n ScanExecutionSupport,\n ScanQueryCapabilities,\n ScanQueryMetadata,\n ScanQueryMetadataOptions,\n ScanQueryMetadataProvider,\n ScanRasterLevel,\n ScanSourceStatistics,\n ScanSpatialMetadata,\n TableScanReadOptions,\n TableScanSource\n} from '@loaders.gl/core/loader-utils';\nexport type {ScanQuery} from './scan-query';\n\nexport {\n FEDERATED_TABLE_QUERY_CAPABILITIES,\n FederatedTableScanSource,\n getFederatedTableBatchProvenance\n} from './federated-table-scan-source';\nexport type {\n FederatedTableBatch,\n FederatedTableBatchProvenance,\n FederatedTableScanExplain,\n FederatedTableScanSourceOptions,\n FederatedTableSchemaPolicy,\n FederatedTableSourceEntry,\n FederatedTableSourceExplain\n} from './federated-table-scan-source';\n\nexport {\n AddressedVectorTableScanSource,\n VectorFeatureTableScanSource,\n VectorTileTableScanSource\n} from './vector-table-scan-source';\nexport type {\n VectorFeatureTableScanSourceOptions,\n VectorTableScanSourceOptions,\n VectorTileTableScanSourceOptions\n} from './vector-table-scan-source';\n\nexport {bindSQLPredicate} from './bind-sql-predicate';\nexport {\n isSQLPredicate,\n SQL_PREDICATE_JSON_SCHEMA,\n validateSQLPredicate\n} from './sql-predicate-schema';\nexport {isSQLPredicateParameter} from './sql-predicate-types';\nexport type {\n BoundSQLPredicate,\n SQLComparisonPredicate,\n SQLInPredicate,\n SQLLogicalPredicate,\n SQLNotPredicate,\n SQLNullPredicate,\n SQLPredicateParameter,\n SQLPredicateParameterValues,\n SQLPredicateParserOptions,\n SQLPredicateProperty,\n SQLPredicateScalar,\n SQLPredicateValue\n} from './sql-predicate-types';\nexport {explainTableQuery, getSQLPredicateColumnNames, planTableQuery} from './table-query';\nexport type {\n TableQueryPlan,\n TableQueryPlanStep,\n TableQueryFilterStep,\n TableQueryLimitStep,\n TableQueryProjectStep,\n TableQueryScanStep\n} from './table-query';\n\nexport {\n normalizeTableQuery,\n planLogicalTableQuery\n} from '../loader-utils/lib/scan-utils/logical-table-query';\nexport type {\n NormalizedTableSelection,\n NormalizedTableQuery,\n LogicalTableQueryProjectStep,\n LogicalTableQueryPlan\n} from '../loader-utils/lib/scan-utils/logical-table-query';\n\nexport {queryGroupedSQL} from './query-grouped-sql';\nexport {preloadQuery, query, queryInBatches, queryProgressive} from './query';\nexport type {\n ProgressiveAggregate,\n ProgressiveAggregateQuery,\n ProgressiveQueryOptions,\n ProgressiveQuerySnapshot\n} from './query-progressive';\nexport type {\n Query,\n QueryOptions,\n SQLQueryParser,\n TypedTableQuery,\n TypedColumnSelection,\n TypedColumnType\n} from './query';\n\nexport {createQueryMetadata} from '@loaders.gl/core/loader-utils';\nexport type {\n CreateQueryMetadataOptions,\n QueryMetadata,\n QueryMetadataOptions,\n QueryCapabilities,\n TableQuerySource,\n TableQueryReadOptions,\n TableQueryPushdownRequest,\n TableQueryPushdownPlan,\n TableQueryCapabilities,\n QueryPushdownCapabilityHints\n} from '@loaders.gl/core/loader-utils';\n\nexport type {ArrowQueryWorkerOptions, ArrowQueryWorkerSession} from './arrow-query-worker';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n compileColumnarPredicate,\n type ColumnarPredicate,\n type ColumnarPredicateReader\n} from '@math.gl/sql/columnar-predicate';\nimport type {ArrayType} from '@loaders.gl/core/schema';\n\nexport {\n bindColumnarPredicateParameters,\n copyColumnarPredicate,\n getColumnarPredicateColumns,\n getColumnarPredicateParameterNames,\n getColumnarPredicatePath,\n getColumnarPredicatePaths,\n isColumnarPredicateParameter,\n isColumnarPredicateValue,\n validateColumnarPredicate,\n type ColumnarComparisonPredicate,\n type ColumnarInPredicate,\n type ColumnarLogicalPredicate,\n type ColumnarNotPredicate,\n type ColumnarNullPredicate,\n type ColumnarPredicate,\n type ColumnarPredicateInputValue,\n type ColumnarPredicateParameter,\n type ColumnarPredicateParameterValues,\n type ColumnarPredicateProperty,\n type ColumnarPredicateValue,\n type ParameterizedColumnarPredicate\n} from '@math.gl/sql/columnar-predicate';\n\n/** Finds the source rows matching a bound portable predicate. */\nexport function filterColumnarRowIndices(\n predicate: ColumnarPredicate | undefined,\n columns: Record<string, ArrayType>,\n rowCount: number\n): number[] {\n if (!predicate) return Array.from({length: rowCount}, (_, index) => index);\n const evaluate = compileColumnarPredicate(predicate, path => bindColumnarReader(columns, path));\n const result: number[] = [];\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n if (evaluate(rowIndex) === true) result.push(rowIndex);\n }\n return result;\n}\n\n/** Gathers selected rows from format-neutral column arrays. */\nexport function gatherColumnarColumns(\n columns: Record<string, ArrayType>,\n rowIndices: readonly number[],\n selectedColumns?: ReadonlySet<string>\n): Record<string, ArrayType> {\n const result: Record<string, ArrayType> = {};\n for (const [name, column] of Object.entries(columns)) {\n if (!selectedColumns || selectedColumns.has(name)) {\n result[name] = rowIndices.map(rowIndex => (column as ArrayLike<unknown>)[rowIndex]);\n }\n }\n return result;\n}\n\n/** Binds a portable predicate path to one source column. */\nfunction bindColumnarReader(\n columns: Record<string, ArrayType>,\n [name, ...path]: readonly string[]\n): ColumnarPredicateReader {\n const column = columns[name];\n return rowIndex => {\n let value = column?.[rowIndex];\n for (const property of path) {\n if (value == null) return null;\n value = value[property];\n }\n return value as ReturnType<ColumnarPredicateReader>;\n };\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n getColumnarPredicateColumns,\n validateColumnarPredicate,\n type ColumnarPredicate,\n type ColumnarPredicateProperty\n} from './columnar-predicate';\n\n/** One source column selected for logical output, optionally under a new name. */\nexport type TableSelection =\n | string\n | Readonly<{\n /** Source column name, resolved before aliases are applied. */\n column: string;\n /** Output field name. Defaults to the source column name. */\n as?: string;\n }>;\n\n/** Named source, or a named table exposed by a source. Strings are literal names, not dotted paths. */\nexport type TableReference =\n | string\n | Readonly<{\n /** Name of a registered data source. */\n source: string;\n /** Name of a table exposed by that source. */\n table: string;\n }>;\n\n/** Logical query description, independent of cancellation and execution observers. */\nexport type TableQuery<\n PredicateT extends ColumnarPredicate<unknown, ColumnarPredicateProperty> = ColumnarPredicate\n> = Readonly<{\n /** Optional named source or qualified table selected before planning. */\n from?: TableReference;\n /** Output columns in selection order. Omission selects all source columns. */\n select?: readonly TableSelection[];\n /** Predicate evaluated against source columns before output aliases are applied. */\n where?: PredicateT;\n /** Number of filtered rows skipped before applying the limit. */\n offset?: number;\n /** Maximum number of rows retained after filtering and offset. */\n limit?: number;\n}>;\n\n/** Controls one execution without becoming part of the logical query. */\nexport type TableQueryExecutionOptions = Readonly<{\n /** Cooperatively cancels source discovery and execution. */\n signal?: AbortSignal;\n /** Receives one terminal summary, including cancellation, failure, and early termination. */\n onQueryComplete?: import('./scan-query-metadata').TableQueryCompleteCallback;\n}>;\n\n/** Immutable, backend-neutral request for a scan, filter, projection, and limit. */\nexport type TableQueryOptions<\n PredicateT extends ColumnarPredicate<unknown, ColumnarPredicateProperty> = ColumnarPredicate\n> = Pick<TableQueryExecutionOptions, 'signal'> &\n Readonly<{\n /** Portable predicate applied before projection. */\n predicate?: PredicateT;\n /** Output columns in caller-specified order. Defaults to every source column. */\n columns?: readonly string[];\n /** Maximum number of rows retained after filtering and projection. */\n limit?: number;\n }>;\n\n/** Reads the minimum source columns required by the remaining table-query plan. */\nexport type TableQueryScanStep = Readonly<{\n /** Plan discriminator. */\n kind: 'scan';\n /** Source columns required for filtering and output. */\n columns: readonly string[];\n}>;\n\n/** Applies a portable predicate while all predicate columns remain available. */\nexport type TableQueryFilterStep<PredicateT = ColumnarPredicate> = Readonly<{\n /** Plan discriminator. */\n kind: 'filter';\n /** Predicate evaluated using three-valued Boolean semantics. */\n predicate: PredicateT;\n}>;\n\n/** Narrows the result to requested output columns. */\nexport type TableQueryProjectStep = Readonly<{\n /** Plan discriminator. */\n kind: 'project';\n /** Output columns in caller-specified order. */\n columns: readonly string[];\n}>;\n\n/** Retains the first rows in source order after filtering and projection. */\nexport type TableQueryLimitStep = Readonly<{\n /** Plan discriminator. */\n kind: 'limit';\n /** Maximum number of retained rows. */\n limit: number;\n}>;\n\n/** One immutable operation in a normalized table-query plan. */\nexport type TableQueryPlanStep<PredicateT = ColumnarPredicate> =\n | TableQueryScanStep\n | TableQueryFilterStep<PredicateT>\n | TableQueryProjectStep\n | TableQueryLimitStep;\n\n/** Immutable logical query plan shared by CPU, SQL, and GPU backends. */\nexport type TableQueryPlan<PredicateT = ColumnarPredicate> =\n readonly TableQueryPlanStep<PredicateT>[];\n\n/** Capability levels for an individual portable table-query operator. */\nexport type TableQueryOperatorSupport =\n | 'unsupported'\n | 'residual'\n | 'pushdown'\n | 'pushdown+residual';\n\n/** Optimization and correctness capabilities advertised by a table-query backend. */\nexport type TableQueryCapabilities = Readonly<{\n /** Whether output projection can avoid reading unrequested columns. */\n projection: TableQueryOperatorSupport;\n /** Whether predicates are unsupported, residual, pushed down, or both pushed and residual. */\n predicate: TableQueryOperatorSupport;\n /** Whether limits are unsupported, applied after execution, or stop physical work early. */\n limit: TableQueryOperatorSupport;\n /** Whether exact CAST semantics can execute at the source; conversions require negotiation. */\n cast?: TableQueryOperatorSupport;\n /** Whether the source can skip filtered rows before its limit. */\n offset?: TableQueryOperatorSupport;\n /** Whether the backend can stream bounded result batches. */\n streaming: boolean;\n /** Whether active and queued physical work observes cancellation. */\n cancellation: boolean;\n /** Whether scalar expressions can be evaluated before projection. */\n expressions?: TableQueryOperatorSupport;\n /** Whether output rows can be ordered before the global limit. */\n orderBy?: TableQueryOperatorSupport;\n /** Whether grouped aggregate output is supported. */\n aggregates?: TableQueryOperatorSupport;\n}>;\n\n/**\n * Produces the canonical scan, filter, project, and limit sequence for a table query.\n *\n * Predicate columns are retained by the scan even if callers omit them from the output projection.\n * This makes SQL `WHERE` semantics independent of a backend's internal API call order.\n */\nexport function planTableQuery<\n ValueT,\n PropertyT extends ColumnarPredicateProperty,\n PredicateT extends ColumnarPredicate<ValueT, PropertyT>\n>(\n sourceColumnNames: readonly string[],\n options: TableQueryOptions<PredicateT> = {}\n): TableQueryPlan<PredicateT> {\n validateTableQueryOptions(sourceColumnNames, options);\n\n const outputColumnNames = options.columns ? [...options.columns] : [...sourceColumnNames];\n const predicateColumnNames = options.predicate\n ? getColumnarPredicateColumns(options.predicate)\n : [];\n const requiredColumnNames = new Set([...outputColumnNames, ...predicateColumnNames]);\n const scanColumnNames = sourceColumnNames.filter(columnName =>\n requiredColumnNames.has(columnName)\n );\n const steps: TableQueryPlanStep<PredicateT>[] = [\n Object.freeze({kind: 'scan' as const, columns: Object.freeze(scanColumnNames)})\n ];\n\n if (options.predicate) {\n steps.push(Object.freeze({kind: 'filter' as const, predicate: options.predicate}));\n }\n steps.push(Object.freeze({kind: 'project' as const, columns: Object.freeze(outputColumnNames)}));\n if (options.limit !== undefined) {\n steps.push(Object.freeze({kind: 'limit' as const, limit: options.limit}));\n }\n return Object.freeze(steps);\n}\n\n/** Validates a portable table query against the columns exposed by one source. */\nexport function validateTableQueryOptions<\n ValueT,\n PropertyT extends ColumnarPredicateProperty,\n PredicateT extends ColumnarPredicate<ValueT, PropertyT>\n>(sourceColumnNames: readonly string[], options: TableQueryOptions<PredicateT>): void {\n const availableColumnNames = new Set(sourceColumnNames);\n const outputColumnNames = options.columns ?? sourceColumnNames;\n const seenColumnNames = new Set<string>();\n for (const columnName of outputColumnNames) {\n if (!availableColumnNames.has(columnName)) {\n throw new Error(`Table query column not found: ${columnName}`);\n }\n if (seenColumnNames.has(columnName)) {\n throw new Error(`Table query column was selected more than once: ${columnName}`);\n }\n seenColumnNames.add(columnName);\n }\n validateTableQueryLimit(options.limit);\n if (options.predicate) {\n validateColumnarPredicate(options.predicate, availableColumnNames);\n }\n}\n\n/** Validates a portable table-query limit independently of source-schema validation. */\nexport function validateTableQueryLimit(limit: number | undefined): void {\n if (limit !== undefined && (!Number.isSafeInteger(limit) || limit < 0)) {\n throw new Error('Table query limit must be a non-negative safe integer.');\n }\n}\n\n/** Validates a logical row offset before any batches are read. */\nexport function validateTableQueryOffset(offset: number | undefined): void {\n if (offset !== undefined && (!Number.isSafeInteger(offset) || offset < 0)) {\n throw new Error('Table query offset must be a non-negative safe integer.');\n }\n}\n\n/** Static format hints only; omission means unknown and never authorizes execution. */\nexport type QueryPushdownCapabilityHints = Readonly<{\n /** The format may support reading only selected columns. */\n projection?: boolean;\n /** The format may support predicate evaluation or pruning. */\n predicate?: boolean;\n /** An implementation may evaluate some CAST conversions. */\n cast?: boolean;\n /** An implementation may skip rows at the source. */\n offset?: boolean;\n /** An implementation may stop source work after a row limit. */\n limit?: boolean;\n}>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n validateColumnarPredicate,\n type ColumnarPredicate,\n type ColumnarPredicateProperty\n} from './columnar-predicate';\nimport {\n planTableQuery,\n validateTableQueryLimit,\n validateTableQueryOffset,\n type TableQuery,\n type TableReference,\n type TableQueryPlanStep\n} from './table-query';\n\n/** Explicit source-to-output mapping for one selected field. */\nexport type NormalizedTableSelection = Readonly<{\n /** Column read from the source. */\n column: string;\n /** Name of the returned field. */\n as: string;\n}>;\n\n/** Logical query with all output selections expanded into explicit mappings. */\nexport type NormalizedTableQuery<PredicateT = ColumnarPredicate> = Readonly<{\n /** Optional source reference preserved separately from physical scan operations. */\n from?: TableReference;\n /** Output mappings in caller-specified order. */\n select: readonly NormalizedTableSelection[];\n /** Predicate resolved against source names before aliases. */\n where?: PredicateT;\n /** Global number of filtered rows skipped before applying the limit. */\n offset?: number;\n /** Global post-filter row limit. */\n limit?: number;\n}>;\n\n/** Logical projection retaining source names separately from output names. */\nexport type LogicalTableQueryProjectStep = Readonly<{\n /** Plan discriminator. */\n kind: 'project';\n /** Output mappings applied after filtering. */\n select: readonly NormalizedTableSelection[];\n}>;\n\n/** Scan, filter, aliased projection, and limit operations in execution order. */\nexport type LogicalTableQueryPlan<PredicateT = ColumnarPredicate> = readonly (\n | Exclude<TableQueryPlanStep<PredicateT>, {kind: 'project'}>\n | Readonly<{kind: 'offset'; offset: number}>\n | LogicalTableQueryProjectStep\n)[];\n\n/** Validates logical query fields and expands selections without modifying caller input. */\nexport function normalizeTableQuery<\n PredicateT extends ColumnarPredicate<unknown, ColumnarPredicateProperty> = ColumnarPredicate\n>(\n sourceColumnNames: readonly string[],\n query: TableQuery<PredicateT> = {}\n): NormalizedTableQuery<PredicateT> {\n if (!query || typeof query !== 'object' || Array.isArray(query)) {\n throw new Error('Table query must be an object.');\n }\n for (const key of Object.keys(query)) {\n if (!['from', 'select', 'where', 'offset', 'limit'].includes(key)) {\n throw new Error(`Unsupported table query option: ${key}`);\n }\n }\n if (query.select !== undefined && (!Array.isArray(query.select) || query.select.length === 0)) {\n throw new Error('Table query select must be a non-empty array.');\n }\n validateTableReference(query.from);\n validateTableQueryOffset(query.offset);\n validateTableQueryLimit(query.limit);\n if (query.where !== undefined) {\n validateColumnarPredicate(query.where, new Set(sourceColumnNames));\n }\n const outputNames = new Set<string>();\n const select = (query.select ?? sourceColumnNames).map(selection => {\n if (\n typeof selection !== 'string' &&\n (!selection || typeof selection !== 'object' || Array.isArray(selection))\n ) {\n throw new Error('Table query selection must be a column name or {column, as}.');\n }\n if (\n typeof selection !== 'string' &&\n Object.keys(selection).some(key => key !== 'column' && key !== 'as')\n ) {\n throw new Error('Unsupported table query selection field.');\n }\n const column = typeof selection === 'string' ? selection : selection.column;\n const outputName =\n typeof selection === 'string'\n ? selection\n : selection.as === undefined\n ? column\n : selection.as;\n if (typeof column !== 'string' || !sourceColumnNames.includes(column)) {\n throw new Error(`Table query column not found: ${column}`);\n }\n if (typeof outputName !== 'string' || outputName.length === 0) {\n throw new Error('Table query output name must be a non-empty string.');\n }\n if (outputNames.has(outputName)) {\n throw new Error(`Duplicate table query output name: ${outputName}`);\n }\n outputNames.add(outputName);\n return Object.freeze({column, as: outputName});\n });\n // Reuse source-column and predicate validation; aliases never participate in WHERE resolution.\n planTableQuery(sourceColumnNames, {\n columns: [...new Set(select.map(selection => selection.column))],\n predicate: query.where,\n limit: query.limit\n });\n return Object.freeze({\n select: Object.freeze(select),\n ...(query.from === undefined\n ? {}\n : {from: typeof query.from === 'string' ? query.from : Object.freeze({...query.from})}),\n ...(query.where === undefined ? {} : {where: query.where}),\n ...(query.offset === undefined ? {} : {offset: query.offset}),\n ...(query.limit === undefined ? {} : {limit: query.limit})\n });\n}\n\n/** Builds a logical plan using the shared scan planner and an explicit aliased projection. */\nexport function planLogicalTableQuery<\n PredicateT extends ColumnarPredicate<unknown, ColumnarPredicateProperty> = ColumnarPredicate\n>(\n sourceColumnNames: readonly string[],\n query: TableQuery<PredicateT> = {}\n): LogicalTableQueryPlan<PredicateT> {\n const normalized = normalizeTableQuery(sourceColumnNames, query);\n const plan = planTableQuery(sourceColumnNames, {\n columns: [...new Set(normalized.select.map(selection => selection.column))],\n predicate: normalized.where,\n limit: normalized.limit\n });\n const steps: LogicalTableQueryPlan<PredicateT>[number][] = [];\n for (const step of plan) {\n if (step.kind === 'limit' && normalized.offset !== undefined)\n steps.push(Object.freeze({kind: 'offset', offset: normalized.offset}));\n steps.push(\n step.kind === 'project' ? Object.freeze({kind: 'project', select: normalized.select}) : step\n );\n }\n if (normalized.limit === undefined && normalized.offset !== undefined)\n steps.push(Object.freeze({kind: 'offset', offset: normalized.offset}));\n return Object.freeze(steps);\n}\n\n/** Validates identifiers without interpreting dots or rewriting quoted names. */\nexport function validateTableReference(\n reference: unknown\n): asserts reference is TableReference | undefined {\n if (reference === undefined) return;\n if (typeof reference === 'string' && reference.trim()) return;\n if (reference && typeof reference === 'object' && !Array.isArray(reference)) {\n const value = reference as Record<string, unknown>;\n if (\n Object.keys(value).every(key => key === 'source' || key === 'table') &&\n typeof value.source === 'string' &&\n value.source.trim() &&\n typeof value.table === 'string' &&\n value.table.trim()\n )\n return;\n }\n throw new Error('FROM must be a source name or {source, table} with non-empty names.');\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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,MAAI,OAAO,cAAc,YAAY,UAAU,KAAK,EAAG;AACvD,MAAI,aAAa,OAAO,cAAc,YAAY,CAAC,MAAM,QAAQ,SAAS,GAAG;AAC3E,UAAM,QAAQ;AACd,QACE,OAAO,KAAK,KAAK,EAAE,MAAM,SAAO,QAAQ,YAAY,QAAQ,OAAO,KACnE,OAAO,MAAM,WAAW,YACxB,MAAM,OAAO,KAAK,KAClB,OAAO,MAAM,UAAU,YACvB,MAAM,MAAM,KAAK;AAEjB;AAAA,EACJ;AACA,QAAM,IAAI,MAAM,qEAAqE;AACvF;;;AH1BA,+BAA8B;AAC9B,mBAAoE;AAgBpE,IAAAC,uBAAkC;",
6
6
  "names": ["import_loader_utils", "import_table_query", "import_columnar_predicate", "query", "import_loader_utils"]
7
7
  }
@@ -3,6 +3,7 @@ export { executeTableScanBatches, filterTableBatch, projectTableBatch, projectTa
3
3
  export type { TableScanBatchReader, TableScanBatchOperators } from '@loaders.gl/core/loader-utils';
4
4
  export type { ScanBackend, ScanBackendLoader, ScanBackendName, ScanEngine, ScanEngineOptions } from "./scan-engine.js";
5
5
  export { parseSQLPredicate } from "./parse-sql-predicate.js";
6
+ export type { ArrowFilterOptions } from "./arrow-execution.js";
6
7
  export type { ArrowQueryOptions } from "./query-arrow-table.js";
7
8
  export type { SQLPredicate } from "./sql-predicate-types.js";
8
9
  export type { RelationalAggregate, RelationalExpression, RelationalOrderKey, TableQuery, TableReference, TableSourceCollection, TableSelection, TableQueryExecutionOptions, TableQueryOptions } from '@loaders.gl/core/loader-utils';
@@ -13,8 +14,6 @@ export { FEDERATED_TABLE_QUERY_CAPABILITIES, FederatedTableScanSource, getFedera
13
14
  export type { FederatedTableBatch, FederatedTableBatchProvenance, FederatedTableScanExplain, FederatedTableScanSourceOptions, FederatedTableSchemaPolicy, FederatedTableSourceEntry, FederatedTableSourceExplain } from "./federated-table-scan-source.js";
14
15
  export { AddressedVectorTableScanSource, VectorFeatureTableScanSource, VectorTileTableScanSource } from "./vector-table-scan-source.js";
15
16
  export type { VectorFeatureTableScanSourceOptions, VectorTableScanSourceOptions, VectorTileTableScanSourceOptions } from "./vector-table-scan-source.js";
16
- export { ARROW_TABLE_QUERY_CAPABILITIES, explainArrowTableQuery } from "./plan-arrow-table-query.js";
17
- export { queryArrowTable } from "./query-arrow-table.js";
18
17
  export { bindSQLPredicate } from "./bind-sql-predicate.js";
19
18
  export { isSQLPredicate, SQL_PREDICATE_JSON_SCHEMA, validateSQLPredicate } from "./sql-predicate-schema.js";
20
19
  export { isSQLPredicateParameter } from "./sql-predicate-types.js";
@@ -23,13 +22,11 @@ export { explainTableQuery, getSQLPredicateColumnNames, planTableQuery } from ".
23
22
  export type { TableQueryPlan, TableQueryPlanStep, TableQueryFilterStep, TableQueryLimitStep, TableQueryProjectStep, TableQueryScanStep } from "./table-query.js";
24
23
  export { normalizeTableQuery, planLogicalTableQuery } from "../loader-utils/lib/scan-utils/logical-table-query.js";
25
24
  export type { NormalizedTableSelection, NormalizedTableQuery, LogicalTableQueryProjectStep, LogicalTableQueryPlan } from "../loader-utils/lib/scan-utils/logical-table-query.js";
26
- export { projectArrowTable, filterArrowTable } from "./arrow-execution.js";
27
- export type { ArrowFilterOptions } from "./arrow-execution.js";
28
25
  export { queryGroupedSQL } from "./query-grouped-sql.js";
29
26
  export { preloadQuery, query, queryInBatches, queryProgressive } from "./query.js";
30
27
  export type { ProgressiveAggregate, ProgressiveAggregateQuery, ProgressiveQueryOptions, ProgressiveQuerySnapshot } from "./query-progressive.js";
31
28
  export type { Query, QueryOptions, SQLQueryParser, TypedTableQuery, TypedColumnSelection, TypedColumnType } from "./query.js";
32
29
  export { createQueryMetadata } from '@loaders.gl/core/loader-utils';
33
30
  export type { CreateQueryMetadataOptions, QueryMetadata, QueryMetadataOptions, QueryCapabilities, TableQuerySource, TableQueryReadOptions, TableQueryPushdownRequest, TableQueryPushdownPlan, TableQueryCapabilities, QueryPushdownCapabilityHints } from '@loaders.gl/core/loader-utils';
34
- export { createArrowQueryWorker, queryArrowTableInWorker, type ArrowQueryWorkerOptions, type ArrowQueryWorkerSession } from "./arrow-query-worker.js";
31
+ export type { ArrowQueryWorkerOptions, ArrowQueryWorkerSession } from "./arrow-query-worker.js";
35
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scan/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,gBAAgB,EAAE,mBAAmB,EAAC,yBAAsB;AAGpE,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAC,oBAAoB,EAAE,uBAAuB,EAAC,MAAM,+BAA+B,CAAC;AACjG,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,iBAAiB,EAClB,yBAAsB;AAIvB,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AACxD,YAAY,EAAC,iBAAiB,EAAC,+BAA4B;AAC3D,YAAY,EAAC,YAAY,EAAC,iCAA8B;AACxD,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,8BAA8B,EAC9B,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,gCAAgC,EAChC,oBAAoB,E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ate } from "./parse-sql-predicate.js";
11
11
  export { createScanQueryMetadata, intersectPointCloudBounds, selectPointCloudScanTiles, validatePointCloudQueryOptions } from '@loaders.gl/core/loader-utils';
12
12
  export { FEDERATED_TABLE_QUERY_CAPABILITIES, FederatedTableScanSource, getFederatedTableBatchProvenance } from "./federated-table-scan-source.js";
13
13
  export { AddressedVectorTableScanSource, VectorFeatureTableScanSource, VectorTileTableScanSource } from "./vector-table-scan-source.js";
14
- export { ARROW_TABLE_QUERY_CAPABILITIES, explainArrowTableQuery } from "./plan-arrow-table-query.js";
15
- export { queryArrowTable } from "./query-arrow-table.js";
16
14
  export { bindSQLPredicate } from "./bind-sql-predicate.js";
17
15
  export { isSQLPredicate, SQL_PREDICATE_JSON_SCHEMA, validateSQLPredicate } from "./sql-predicate-schema.js";
18
16
  export { isSQLPredicateParameter } from "./sql-predicate-types.js";
19
17
  export { explainTableQuery, getSQLPredicateColumnNames, planTableQuery } from "./table-query.js";
20
18
  export { normalizeTableQuery, planLogicalTableQuery } from "../loader-utils/lib/scan-utils/logical-table-query.js";
21
- export { projectArrowTable, filterArrowTable } from "./arrow-execution.js";
22
19
  export { queryGroupedSQL } from "./query-grouped-sql.js";
23
20
  export { preloadQuery, query, queryInBatches, queryProgressive } from "./query.js";
24
21
  export { createQueryMetadata } from '@loaders.gl/core/loader-utils';
25
- export { createArrowQueryWorker, queryArrowTableInWorker } from "./arrow-query-worker.js";
26
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scan/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,gBAAgB,EAAE,mBAAmB,EAAC,yBAAsB;AACpE,iGAAiG;AACjG,2FAA2F;AAC3F,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,+BAA+B,CAAC;AAUvC,iG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,EACnB,MAAM,+BAA+B,CAAC;AAUvC,iGAAiG;AACjG,0FAA0F;AAC1F,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AAgBxD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,+BAA+B,CAAC;AAiCvC,OAAO,EACL,kCAAkC,EAClC,wBAAwB,EACxB,gCAAgC,EACjC,yCAAsC;AAWvC,OAAO,EACL,8BAA8B,EAC9B,4BAA4B,EAC5B,yBAAyB,EAC1B,sCAAmC;AAOpC,OAAO,EAAC,gBAAgB,EAAC,gCAA6B;AACtD,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACrB,kCAA+B;AAChC,OAAO,EAAC,uBAAuB,EAAC,iCAA8B;AAe9D,OAAO,EAAC,iBAAiB,EAAE,0BAA0B,EAAE,cAAc,EAAC,yBAAsB;AAU5F,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACtB,8DAA2D;AAQ5D,OAAO,EAAC,eAAe,EAAC,+BAA4B;AACpD,OAAO,EAAC,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAC,mBAAgB;AAgB9E,OAAO,EAAC,mBAAmB,EAAC,MAAM,+BAA+B,CAAC"}
@@ -86,7 +86,7 @@ var NPM_TAG = "latest";
86
86
 
87
87
  // dist/worker-utils/lib/env-utils/version.js
88
88
  function getVersion() {
89
- const version2 = false ? NPM_TAG : "5.0.1";
89
+ const version2 = false ? NPM_TAG : "5.0.2";
90
90
  globalThis._loadersgl_ = globalThis._loadersgl_ || {};
91
91
  globalThis._loadersgl_.version ||= version2;
92
92
  return version2;
@@ -125,7 +125,7 @@ var import_tasks2 = require("@math.gl/tasks");
125
125
 
126
126
  // dist/loader-utils/lib/log-utils/log.js
127
127
  var import_log = require("probe.gl/log");
128
- var VERSION2 = true ? "5.0.1" : "latest";
128
+ var VERSION2 = true ? "5.0.2" : "latest";
129
129
  var version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
130
130
  function createLog() {
131
131
  const log2 = new import_log.Log({ id: "loaders.gl" });
@@ -4,7 +4,7 @@
4
4
  import { NPM_TAG } from "../npm-tag.js";
5
5
  /** Return this package's injected version, independent of other loaded versions. */
6
6
  function getVersion() {
7
- const version = typeof "5.0.1" === 'undefined' ? NPM_TAG : "5.0.1";
7
+ const version = typeof "5.0.2" === 'undefined' ? NPM_TAG : "5.0.2";
8
8
  globalThis._loadersgl_ = globalThis._loadersgl_ || {};
9
9
  globalThis._loadersgl_.version ||= version;
10
10
  return version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/core",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "Core loading and writing APIs, workers, schemas, and geometry utilities for loaders.gl",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -440,7 +440,7 @@
440
440
  "probe.gl": "^5.0.0",
441
441
  "zod": "^4.1.12"
442
442
  },
443
- "gitHead": "e28aef9d87913a5f04901ed503aefefb85e2e700",
443
+ "gitHead": "47b6fd15a0ca3c37b5f315fde24a62a4218e7bb9",
444
444
  "peerDependencies": {
445
445
  "sharp": "^0.35.5"
446
446
  },
@@ -472,6 +472,7 @@ export type {TileSourceMetadata, GetTileParameters} from './lib/sources/tile-sou
472
472
  export type {GetTileDataBatchResult, GetTileDataParameters} from './lib/sources/tile-source';
473
473
  export {getTileDataBatch} from './lib/sources/tile-source-utils';
474
474
  export {TileSourceAdapter} from './lib/sources/tile-source-adapter';
475
+ export {readRasterTile} from './lib/sources/raster-tile';
475
476
 
476
477
  export type {ImageTileSource} from './lib/sources/image-tile-source';
477
478
 
@@ -487,6 +488,7 @@ export type {
487
488
  RasterData,
488
489
  RasterSelection,
489
490
  GetRasterParameters,
491
+ GetRasterTileParameters,
490
492
  RasterOverview,
491
493
  RasterSourceMetadata
492
494
  } from './lib/sources/raster-source';
@@ -126,6 +126,16 @@ export type GetRasterParameters = {
126
126
  signal?: AbortSignal;
127
127
  };
128
128
 
129
+ /** Experimental request for one tile of the source's native raster grid. */
130
+ export type GetRasterTileParameters = Omit<GetRasterParameters, 'viewport' | 'resampleMethod'> & {
131
+ /** Identifier of a matrix in the source's tile grid. */
132
+ tileMatrix: string;
133
+ /** Native tile column. */
134
+ x: number;
135
+ /** Native tile row. */
136
+ y: number;
137
+ };
138
+
129
139
  /**
130
140
  * Description of one available overview level.
131
141
  */
@@ -176,8 +186,13 @@ export type RasterSourceMetadata = {
176
186
  supportsRegion?: boolean;
177
187
  /** Native tile dimensions when the source is tiled. */
178
188
  tileSize?: {width: number; height: number};
179
- /** Native tiled overview geometry; matrix IDs are source image indices. Edge tiles may extend beyond raster bounds. */
189
+ /** Native tiled overview geometry with source-assigned matrix IDs. Edge tiles may extend beyond raster bounds. */
180
190
  tileGrid?: TileGrid;
191
+ /**
192
+ * IDs in `tileGrid` that the source can read with the default bands (experimental).
193
+ * The source checks whether the requested matrix supports an explicit band selection.
194
+ */
195
+ nativeTileMatrixIds?: string[];
181
196
  /** Available overview levels. */
182
197
  overviews?: RasterOverview[];
183
198
  /** Source no-data value when defined. */
@@ -206,6 +221,8 @@ export interface RasterSource<
206
221
  }): Promise<MetadataT>;
207
222
  /** Loads raster samples for the supplied viewport request. */
208
223
  getRaster(parameters: ParametersT): Promise<DataT>;
224
+ /** Experimental. Reads one native tile without resampling, or null for an unavailable tile. */
225
+ getRasterTile?(parameters: GetRasterTileParameters): Promise<NumericRasterData | null>;
209
226
  }
210
227
 
211
228
  /**
@@ -0,0 +1,46 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+
5
+ import type {GetRasterTileParameters, NumericRasterData, RasterSource} from './raster-source';
6
+ import {resolveTileGridTile} from './tile-grid';
7
+ import {waitForPromiseWithSignal} from '../request-utils/abort-utils';
8
+
9
+ /**
10
+ * Reads one native tile without resampling (experimental).
11
+ * Uses the advertised matrix IDs for default bands and lets the source validate explicit bands.
12
+ */
13
+ export async function readRasterTile(
14
+ source: RasterSource<NumericRasterData>,
15
+ parameters: GetRasterTileParameters
16
+ ): Promise<NumericRasterData | null> {
17
+ const {tileMatrix, bands, signal} = parameters;
18
+ signal?.throwIfAborted();
19
+ const {tileGrid, nativeTileMatrixIds} = await waitForPromiseWithSignal(
20
+ source.getMetadata({signal}),
21
+ signal
22
+ );
23
+ signal?.throwIfAborted();
24
+ const matrixSet = tileGrid?.tileMatrixSet;
25
+ if (!matrixSet?.crs || !matrixSet.matrices.length)
26
+ throw new Error('readRasterTile requires a complete native tile matrix set');
27
+
28
+ const resolved = resolveTileGridTile(tileGrid, {...parameters, z: 0});
29
+ const matrix = matrixSet.matrices.find(candidate => candidate.id === tileMatrix)!;
30
+ if (bands === undefined && nativeTileMatrixIds && !nativeTileMatrixIds.includes(tileMatrix))
31
+ throw new Error(
32
+ `Tile matrix "${tileMatrix}" does not support native tile reads. Readable matrix IDs: ${JSON.stringify(nativeTileMatrixIds)}`
33
+ );
34
+ if (!resolved) return null;
35
+ if (!source.getRasterTile) throw new Error('Raster source does not support native tile reads');
36
+
37
+ const raster = await waitForPromiseWithSignal(
38
+ source.getRasterTile({...parameters, x: resolved.x}),
39
+ signal
40
+ );
41
+ signal?.throwIfAborted();
42
+ if (!raster) return null;
43
+ if (raster.width !== matrix.tileSize[0] || raster.height !== matrix.tileSize[1])
44
+ throw new Error(`Raster tile dimensions do not match matrix "${tileMatrix}"`);
45
+ return raster;
46
+ }
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- export {ARROW_TABLE_QUERY_CAPABILITIES} from './plan-arrow-table-query';
5
+ export {ARROW_TABLE_QUERY_CAPABILITIES, explainArrowTableQuery} from './plan-arrow-table-query';
6
6
  export {queryArrowTable} from './query-arrow-table';
7
7
  export {queryArrowTableInBatches} from './query-arrow-table-in-batches';
8
8
  export {getSQLPredicateColumnNames, planTableQuery} from './table-query';
package/src/scan/index.ts CHANGED
@@ -24,6 +24,7 @@ export type {
24
24
  // Re-export the query vocabulary from one optional entry point for applications. Format adapters
25
25
  // should continue importing the lightweight contracts from @loaders.gl/core/loader-utils.
26
26
  export {parseSQLPredicate} from './parse-sql-predicate';
27
+ export type {ArrowFilterOptions} from './arrow-execution';
27
28
  export type {ArrowQueryOptions} from './query-arrow-table';
28
29
  export type {SQLPredicate} from './sql-predicate-types';
29
30
  export type {
@@ -102,8 +103,6 @@ export type {
102
103
  VectorTileTableScanSourceOptions
103
104
  } from './vector-table-scan-source';
104
105
 
105
- export {ARROW_TABLE_QUERY_CAPABILITIES, explainArrowTableQuery} from './plan-arrow-table-query';
106
- export {queryArrowTable} from './query-arrow-table';
107
106
  export {bindSQLPredicate} from './bind-sql-predicate';
108
107
  export {
109
108
  isSQLPredicate,
@@ -146,9 +145,6 @@ export type {
146
145
  LogicalTableQueryPlan
147
146
  } from '../loader-utils/lib/scan-utils/logical-table-query';
148
147
 
149
- export {projectArrowTable, filterArrowTable} from './arrow-execution';
150
- export type {ArrowFilterOptions} from './arrow-execution';
151
-
152
148
  export {queryGroupedSQL} from './query-grouped-sql';
153
149
  export {preloadQuery, query, queryInBatches, queryProgressive} from './query';
154
150
  export type {
@@ -180,9 +176,4 @@ export type {
180
176
  QueryPushdownCapabilityHints
181
177
  } from '@loaders.gl/core/loader-utils';
182
178
 
183
- export {
184
- createArrowQueryWorker,
185
- queryArrowTableInWorker,
186
- type ArrowQueryWorkerOptions,
187
- type ArrowQueryWorkerSession
188
- } from './arrow-query-worker';
179
+ export type {ArrowQueryWorkerOptions, ArrowQueryWorkerSession} from './arrow-query-worker';