You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "sathesuraj (via GitHub)" <gi...@apache.org> on 2025/09/01 18:22:24 UTC

[PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

sathesuraj opened a new pull request, #2485:
URL: https://github.com/apache/polaris/pull/2485

   Explicitly defined integer columns as INT4 in SQL script so that a CockroachDB JDBC driver correctly maps them to Java's Integer type, despite them being stored internally as INT8 in CockroachDB. This enables CockroachDB support for the metastore and will continue to work for PostgreSQL.
   
   Fixes: apache/polaris#2464


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #2485: Use INT4 type alias for CockroachDB JDBC compatibility
URL: https://github.com/apache/polaris/pull/2485


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #2485:
URL: https://github.com/apache/polaris/pull/2485#issuecomment-3386559922

   @sathesuraj. I'm fine with adding test in another PR by other contributors if you don't have time. Thanks a lot for the contribution!


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on PR #2485:
URL: https://github.com/apache/polaris/pull/2485#issuecomment-3246222256

   If we do not add tests in this PR, let's keep #2464 open until we have end-to-end tests.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2485:
URL: https://github.com/apache/polaris/pull/2485#issuecomment-3363877973

   This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "sathesuraj (via GitHub)" <gi...@apache.org>.
sathesuraj commented on PR #2485:
URL: https://github.com/apache/polaris/pull/2485#issuecomment-3385521394

   > This is a nice improvement. I'd love to see this to be merged. We may also need to check the specific SQL code of Cockroach DB. The current SQL codes are all from Postgres, https://github.com/polaris-catalog/polaris/blob/main/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatasourceOperations.java#L55-L55
   
   @flyrain  - Unfortunately, I could not spend time to add end-to-end tests for this change. I'll try to work on the comments and will update this PR. 


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on PR #2485:
URL: https://github.com/apache/polaris/pull/2485#issuecomment-3382589353

   This is a nice improvement. I'd love to see this to be merged. We may also need to check the specific SQL code of Cockroach DB. The current SQL codes are all from Postgres, https://github.com/polaris-catalog/polaris/blob/main/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatasourceOperations.java#L55-L55


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on PR #2485:
URL: https://github.com/apache/polaris/pull/2485#issuecomment-4160555303

   superceded by https://github.com/apache/polaris/pull/3352


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #2485:
URL: https://github.com/apache/polaris/pull/2485#discussion_r2314833121


##########
persistence/relational-jdbc/src/main/resources/postgres/schema-v1.sql:
##########
@@ -21,7 +21,7 @@ SET search_path TO POLARIS_SCHEMA;
 
 CREATE TABLE IF NOT EXISTS version (
     version_key TEXT PRIMARY KEY,
-    version_value INTEGER NOT NULL
+    version_value INT4 NOT NULL

Review Comment:
   seems like cocroach-db uses pg driver as we have checks for the display type here 
   https://github.com/apache/polaris/blob/main/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatabaseType.java#L46
   
   would be nice to have a comment.



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 closed pull request #2485: Use INT4 type alias for CockroachDB JDBC compatibility
URL: https://github.com/apache/polaris/pull/2485


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "sathesuraj (via GitHub)" <gi...@apache.org>.
sathesuraj commented on PR #2485:
URL: https://github.com/apache/polaris/pull/2485#issuecomment-3385515474

   @flyrain  - Unfortunately, I could not spend more time to add end-to-end tests for this change. I'll try to work on the comments on this PR. 


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "sathesuraj (via GitHub)" <gi...@apache.org>.
sathesuraj commented on code in PR #2485:
URL: https://github.com/apache/polaris/pull/2485#discussion_r2315462056


##########
persistence/relational-jdbc/src/main/resources/postgres/schema-v1.sql:
##########
@@ -21,7 +21,7 @@ SET search_path TO POLARIS_SCHEMA;
 
 CREATE TABLE IF NOT EXISTS version (
     version_key TEXT PRIMARY KEY,
-    version_value INTEGER NOT NULL
+    version_value INT4 NOT NULL

Review Comment:
   Yes, cockroach DB uses pg driver. I'll add a comment 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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use INT4 type alias for CockroachDB JDBC compatibility [polaris]

Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #2485:
URL: https://github.com/apache/polaris/pull/2485#issuecomment-3487444487

   I think Cockroach really deserves E2E tests.
   While CR has is pg-compatible on the wire, it doesn't behave exactly like "the original PostgreSQL", which is especially true for reported SQL errors, which are IIRC inspected in the code base.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org