Skip to main content
Use POST /tables/previewFromFile to preview a table from a local file upload. The endpoint accepts a multipart form containing a file and a table-preview request object. It returns inferred schema/config details and sampled rows without creating a table.
Use POST /tables/preview when the source file is already reachable from configured storage or a catalog. Use previewFromFile when you need to upload a local file directly to the controller for preview.

Endpoint

Multipart fields: The endpoint simulates a table preview with the uploaded file as the source data. It does not persist the file, create a schema, create a table, or ingest rows.

Basic JSON File Example

Create a request file:
Upload a local file:

Inline Multipart Example

Example Response Shape

The response uses the same preview API shape as /tables/preview. Exact fields vary by source type and request options.

Request Configuration

At minimum, provide a tableConfig with:
  • tableName
  • tableType
  • task.taskTypeConfigsMap.FileIngestionTask.inputFormat
Common inputFormat values: Enable schema inference when you want StarTree to infer fields from the uploaded file:
Provide a schema when you want the preview to validate/sample against a known schema:

Workflow

  1. Build a minimal table config and preview config.
  2. Upload a representative local file with POST /tables/previewFromFile.
  3. Inspect inferred schema, sampled rows, and summary.
  4. Adjust field names, time column, transforms, and indexes.
  5. Use the final schema and table config in the normal table creation flow.

Limits and Operational Notes

  • The endpoint is intended for preview and onboarding workflows, not ingestion.
  • Use representative but bounded sample files; do not upload production-scale data files.
  • The multipart request must include both request and file.
  • The request part must be valid JSON that can deserialize as a table preview request.
  • The file format must match the inputFormat in the request table task config.

Troubleshooting