Manual Ingest
Use manual data insertion for one-time jobs, not for ongoing insertion or ingestion.
For standard data ingestion that scales with load, either use Stream Ingest or Batch Ingest. Use Summary Tables for aggregations.
There are two ways to insert data manually:
- From a query result
- From raw data
Before you begin⚓︎
Set up a table⚓︎
If you don't have a table configured in Hydrolix, make one. See Projects & Tables to create a table.
Configure the default transform⚓︎
The table must have a default transform configured with "is_default": true. Hydrolix uses the default transform's output_columns to discover the column schema when writing data from INSERT INTO statements. The default transform must include:
- The primary timestamp column for the table
- Every column you intend to insert data into, with matching data types
If your table already has a default transform for streaming or batch ingest, you don't need to create a separate one. To check, use either the UI or API:
- UI: Navigate to Data. Select your table and look for
(default)in the list under Table Transforms. - API: List the table's transforms and look for
"is_default": truein the transform settings.
If you need to create a default transform, see Write Transforms for details.
The following example transform defines a table with three columns: a timestamp primary column, a mycolumn1 string column, and a mycolumn2 unsigned integer column. The INSERT INTO examples on this page use this schema.
Insert data⚓︎
You can query another Hydrolix table in the cluster and directly insert the query results. For data not already in the cluster, you can also manually insert data.
Data inserted using INSERT INTO is stored in the default storage location defined in the table settings. Data ingestion features that route data to different storage locations don't affect this behavior. For instance:
- Storage mapping rules aren't evaluated.
- Shard key routing isn't applied.
- Spread list distribution isn't used.
When inserting data, keep these things in mind:
- Insertion fails if the primary timestamp field is missing.
- The transform must be the default:
"is_default": true. - No ingestion scripting features execute when inserting data manually.
Insert from a query result⚓︎
To insert from a query result, combine the INSERT INTO statement with a SELECT statement.
Hydrolix runs the SELECT query and inserts the resulting rows into myproject.mytable.
Insert manually⚓︎
Insert data using literals in SQL statements.
You can insert multiple rows in a single statement.
Those commands insert rows into the table.
The response for the INSERT INTO is a JSON object containing the bytes written, number of partitions, and rows written. Authorization credentials are omitted from the next example. See HTTP Query API for examples.