INSERT¶
Insert data into a Lance table.
Syntax¶
Insert values¶
Insert from query¶
Insert with column list¶
Parameters¶
| Parameter | Description |
|---|---|
table_name |
Fully qualified table name: catalog.schema.table. |
column |
Column name for explicit column mapping. |
value |
Value to insert. |
Examples¶
Insert single row¶
Insert multiple rows¶
INSERT INTO lance.default.products VALUES
(1, 'Widget', 9.99),
(2, 'Gadget', 19.99),
(3, 'Gizmo', 29.99);
Insert with explicit columns¶
Insert from SELECT¶
Insert aggregated data¶
INSERT INTO lance.default.daily_summary
SELECT
current_date as report_date,
COUNT(*) as order_count,
SUM(amount) as total_amount
FROM lance.default.orders
WHERE order_date = current_date;
Limitations¶
- NULL values are inserted for unspecified columns
- DEFAULT values are not supported
- Concurrent inserts to the same table may cause conflicts