v1 and v2 Lakehouse Tables
Insight Factory creates Delta tables in two generations, referred to as v1 and v2. Which generation a table belongs to changes how its column names are derived, which Delta features it has, and how it is updated on each run.
Tables created by older releases are v1. New tables are created as v2. Existing v1 tables keep working and are not converted automatically, so a Lakehouse can hold a mix of both.
Differences between the generations
| Aspect | v1 | v2 |
|---|---|---|
| Row metadata | Separate columns on the table | A single _if_metadata VARIANT column holding row_action, row_action_date and updated_by_task_code |
| Column mapping | Not enabled. Column names are physical Parquet names, so characters such as ( ) , ; { } = - are not legal | delta.columnMapping.mode = name. Those characters are legal in a column name |
| Column name handling | Illegal characters are removed and runs of whitespace are collapsed to a single underscore. This always happens — there is no property to turn it off | Runs of whitespace are collapsed to a single underscore only when Replace Spaces With Underscore In Column Names is set on the Convert … into a Lakehouse table task. It is off unless you set it, and nothing else is altered |
| Type widening | Not enabled | delta.enableTypeWidening |
| Deletion vectors | Not enabled | delta.enableDeletionVectors |
| Row tracking | Not enabled | delta.enableRowTracking |
| Catalog-managed | No | delta.feature.catalogManaged |
| Clustering | As configured | Liquid clustering in most cases, on the business key where one is defined. Tables using the partition-replace update type are partitioned instead — see Clustering and partitioning |
| Dimension surrogate key | Nullable, no primary key | NOT NULL and the table's primary key |
Every feature listed under v2 is a standard Databricks Delta feature. The v1 and v2 labels, and the _if_metadata column that marks a table as v2, are Insight Factory's own.
Checking which generation a table is
A table is v2 if it has a column named _if_metadata.
DESCRIBE TABLE <catalog>.<schema>.<table>;
To list the tables in a catalog that are not v2:
SELECT t.table_schema, t.table_name
FROM <catalog>.information_schema.tables AS t
WHERE NOT EXISTS (
SELECT 1
FROM <catalog>.information_schema.columns AS c
WHERE c.table_schema = t.table_schema
AND c.table_name = t.table_name
AND c.column_name = '_if_metadata'
)
ORDER BY t.table_schema, t.table_name;
This returns every table without an _if_metadata column, which is wider than "every v1 table": anything not created by an Insight Factory ingestion task — enrichment notebook output, or a table someone created by hand — also has no _if_metadata and is listed. Treat the result as a starting point and check each table against the task that maintains it before converting it. Views are listed too, since a view projecting a subset of columns has no _if_metadata either. Add AND t.table_type NOT IN ('VIEW', 'MATERIALIZED_VIEW', 'STREAMING_TABLE') to drop those, or AND t.table_type = 'MANAGED' to narrow the result to managed tables, which excludes external tables as well.
How a task decides which path to take
Insight Factory inspects the target table at the start of each run:
- The table does not exist — it is created as v2.
- The table exists and is v2 — v2 processing.
- The table exists and is v1 — v1 processing, unless the Convert to v2 Structure run option is set.
The fall-back to v1 processing is deliberate. It means an established table keeps its existing column names and structure rather than having them change underneath the reports and queries built on it.
Why column names can differ between environments
This is the most common symptom of a mixed estate, and it is worth understanding before you go looking for a configuration difference.
Because the decision is made from the state of the target table rather than from configuration, the same task definition on the same platform version can produce different column names in two environments. With Replace Spaces With Underscore In Column Names set, a source column named Net Amount (AUD) lands as:
Net_Amount_AUDwhere the target table is v1 — the parentheses are removed and the spaces collapse to underscores.Net_Amount_(AUD)where the target table is v2 — only the spaces are replaced.
Likewise a source column named Week 1-2 Total lands as Week_12_Total against a v1 table and Week_1-2_Total against a v2 table.
This typically shows up when a production line has run in a lower environment for some time — so its tables are v1 — and is then deployed to an environment where the tables are created fresh, and therefore as v2. Downstream SQL written against the lower environment's column names then fails with an unresolved column error:
[UNRESOLVED_COLUMN.WITH_SUGGESTION] A column, variable, or function parameter with
name `Net_Amount_AUD` cannot be resolved. Did you mean one of the following?
[`Net_Amount_(AUD)`, ...]. SQLSTATE: 42703
The suggestion list in that error is the target table's actual column names, which tells you which generation you are looking at.
Replace Spaces With Underscore In Column Names is on the Convert … into a Lakehouse table task, alongside the other Lakehouse table properties, and is off unless you set it. It only collapses spaces into a single underscore — it never removes parentheses, hyphens or any other character, so changing it will not reproduce v1 column names on a v2 table.
The property applies to v2 only. A v1 table collapses whitespace whether or not it is set, so leaving it off widens the gap between the generations rather than closing it: the same source column arrives as Net_Amount_AUD against a v1 table and Net Amount (AUD) against a v2 one.
Upgrading a v1 table to v2
Use the Convert to v2 Structure run option. See Run with Options.
- Right-click the task that maintains the table and select Run > Run with Options.
- Enable Convert to v2 Structure.
- Click Confirm.
The conversion runs as part of that task run and:
- Sets the v2 table properties — column mapping, type widening, deletion vectors, row tracking, catalog-managed, and column defaults.
- Adds the
_if_metadataVARIANT column. - Applies liquid clustering if the table has none, using the business key where one is defined, otherwise
CLUSTER BY AUTOwhere predictive optimisation is enabled on the catalog. - Sets table ownership to the catalog owner.
- For dimension tables, makes the surrogate key
NOT NULLand the table's primary key.
Once converted, the table stays v2 and every subsequent run uses v2 processing.
What conversion does not change
Conversion does not rename existing columns. A converted table keeps its v1 column names, but the next run derives column names using the v2 rules. Where the source has characters that v1 stripped, the run treats the newly derived names as new columns: schema evolution adds them to the table, and the old columns are either dropped or left behind and no longer populated, depending on the update type.
Check the column names your source produces before converting a table whose source has characters other than spaces in its column names. Declaring the names explicitly first, as described in Making column names independent of the generation, avoids the problem entirely.
Conversion also does not move data between storage formats, change the update type, or alter the task configuration.
Before you convert
Dimension tables are rebuilt, not altered. For tables using either of the dimension update types — type 1 (dimension_type1) or type 2 (dimension_type2) — the conversion creates a new table, copies every existing row into it, drops the original and renames the new one into place. Surrogate key values are preserved and the identity sequence continues from the current maximum. It is not a single atomic statement, so run it when the table is not in use and nothing is querying it.
Converting a partitioned table can leave it half converted. Delta does not allow liquid clustering on a partitioned table, and two things decide whether the conversion tries to cluster one: whether the table has a business key, declared in Table Metadata, and whether predictive optimisation is enabled on its catalog. With either, the conversion tries to cluster the table and the run fails. With neither, no clustering is attempted and the conversion completes.
The steps above are separate statements, not one transaction, and clustering comes after the table properties and the _if_metadata column. A run that fails at the clustering step has already committed both, so the table is v2 by the test at the top of this page even though the conversion reported a failure. Table ownership is the step after clustering, so it is not changed.
There is no way back. The next ordinary run succeeds, because the table already exists and nothing retries the clustering that failed — but it takes the v2 path, with v2 column naming. Drop and Recreate Table does not undo it either: the generation is decided from the table before the drop, so the table is recreated as v2. The only remaining route to v1 column names is to declare them with Schema Enforcement Column List.
A new table using the partition-replace update type is created as v2 and partitioned, which is a normal state. Do not convert an existing partitioned table — not because the outcome is unknowable, but because one of the two outcomes is a table left half converted with no way back.
Ownership changes. Conversion sets the table's owner to the catalog owner. If the table is currently owned by someone else, whoever relied on that ownership to grant privileges on the table will no longer be able to.
Do not convert a whole production line at once. Run options apply to every task in a production line, so ticking Convert to v2 Structure on a production line converts every table it maintains in one run — including any dimension and partitioned tables. Convert one task at a time, having checked each table against the points above.
Making column names independent of the generation
If you would rather not have column names depend on the target table's generation at all, declare them explicitly using Schema Enforcement Column List, with a replace action per column. The property is on the Convert … into a Lakehouse table task that builds the Delta table, not on the ingestion task that lands the file. The names are then visible in configuration rather than inferred from a rule, and you can avoid characters that need backtick quoting in downstream SQL.
[
{ "action": "replace", "column_name": "net_amount_aud", "renamed_from": "Net Amount (AUD)" },
{ "action": "replace", "column_name": "week_1_2_total", "renamed_from": "Week 1-2 Total" }
]
renamed_from matches the raw source column name, exactly as it appears in the source, spaces and all. Renaming happens before any generation-specific name handling, in both generations, so the same configuration works against a v1 table and a v2 table.
Give column_name a value that uses only letters, digits and underscores. The name you declare is still subject to the generation's own handling afterwards, so a declared name containing parentheses or hyphens would survive against a v2 table and be stripped against a v1 one — reintroducing the difference you are trying to remove.
This is the recommended approach for any source whose column names contain characters other than letters, digits, spaces and underscores — spreadsheet and SharePoint list sources in particular.