Skip to Content
⚠️Active Development Notice: TimeTiles is under active development. Information may be placeholder content or not up-to-date.

web


web / lib/jobs/handlers/schema-detection-job

lib/jobs/handlers/schema-detection-job

Defines the job handler for detecting the schema from a batch of imported data.

This job processes a batch of rows from the import file to progressively build a schema. It skips rows that were identified as duplicates to ensure the schema is based on unique data.

Key responsibilities include:

  • Using a ProgressiveSchemaBuilder to infer data types and properties for each column.
  • Detecting fields that could be used for geocoding (e.g., address, latitude, longitude).
  • Storing the evolving schema and the builder’s state in the import-jobs document.

After processing all batches, the import job transitions to the SCHEMA_VALIDATION stage.

Variables

schemaDetectionJob

const schemaDetectionJob: object

Type declaration

slug

slug: "detect-schema" = JOB_TYPES.DETECT_SCHEMA

handler()

handler: (context) => Promise<{ output: { completed: true; batchNumber: number; rowsProcessed: number; hasMore: false; }; } | { output: { batchNumber: number; rowsProcessed: number; hasMore: boolean; }; }>

Parameters
context

JobHandlerContext

Returns

Promise<{ output: { completed: true; batchNumber: number; rowsProcessed: number; hasMore: false; }; } | { output: { batchNumber: number; rowsProcessed: number; hasMore: boolean; }; }>

Last updated on