blackmwk commented on code in PR #2380:
URL: https://github.com/apache/iceberg-rust/pull/2380#discussion_r3252774410


##########
crates/catalog/sql/src/catalog.rs:
##########
@@ -297,15 +310,60 @@ impl SqlCatalog {
         .await
         .map_err(from_sqlx_error)?;
 
+        // Check if the catalog table supports views, indicating that the 
schema is V1
+        let is_v1 = sqlx::query(&format!(
+            "SELECT {CATALOG_FIELD_RECORD_TYPE} FROM {CATALOG_TABLE_NAME} 
LIMIT 0"
+        ))
+        .execute(&pool)
+        .await
+        .is_ok();

Review Comment:
   If you can do check for correct error type, then I'm fine. Though sqlx has 
no backend agnostic way to detect, we could provide one for different backends, 
for example pg and mysql has information_schema, and sqlite has table_info. Or 
we could create a follow up issue for it.



-- 
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]

Reply via email to