badalprasadsingh commented on code in PR #1244:
URL: https://github.com/apache/iceberg-go/pull/1244#discussion_r3530814842
##########
catalog/sql/sql.go:
##########
@@ -61,8 +62,37 @@ const (
DialectKey = "sql.dialect"
DriverKey = "sql.driver"
initCatalogTablesKey = "init_catalog_tables"
+
+ // SchemaVersionKey opts in to migrating a legacy V0 catalog (one that
lacks
+ // the iceberg_type column) up to the V1 schema.
+ //
+ // When set to SchemaVersionV1 the catalog issues the one-way ALTER
TABLE
+ // that adds the iceberg_type column; otherwise it stays on V0 and emits
+ // column-free queries that never reference iceberg_type.
+ SchemaVersionKey = "jdbc.schema-version"
+)
+
+const (
+ SchemaVersionV1 = "V1"
)
+// schemaVer tracks which physical layout of the iceberg_tables table the
catalog is operating against.
+//
+// schemaV1 has the iceberg_type column. schemaV0 is the legacy JDBC default
that lacks the column entirely.
+// Queries against a V0 catalog must never reference iceberg_type
+//
+// The zero value is schemaV1
+type schemaVer int
+
+const (
+ schemaV1 schemaVer = iota
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]