This is an automated email from the ASF dual-hosted git repository.

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new fea1c740d [#5318][#5311][#5328] improvement(web): Add jdbc-driver 
properties for Paimon JDBC and fix jdbc issue (#5320)
fea1c740d is described below

commit fea1c740d184b37807c08eda4624c3d523afc4eb
Author: Qian Xia <[email protected]>
AuthorDate: Tue Oct 29 17:46:23 2024 +0800

    [#5318][#5311][#5328] improvement(web): Add jdbc-driver properties for 
Paimon JDBC and fix jdbc issue (#5320)
    
    ### What changes were proposed in this pull request?
    1. Add jdbc-driver properties for Paimon JDBC
    <img width="589" alt="image"
    
src="https://github.com/user-attachments/assets/fd8f5bf2-0f0a-4fbb-b6c5-5531c8d92155";>
    
    3. fix update paimon catalog issue
    
    ### Why are the changes needed?
    
    Fix: #5318
    Fix: #5311
    Fix: #5328
    
    ### Does this PR introduce _any_ user-facing change?
    N/A
    
    ### How was this patch tested?
    manually
---
 .../metalake/rightContent/CreateCatalogDialog.js   | 22 +++++++++++-----------
 web/web/src/lib/utils/initial.js                   |  9 ++++++++-
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git 
a/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js 
b/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js
index 4cb41e6fb..34db30698 100644
--- a/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js
+++ b/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js
@@ -240,10 +240,10 @@ const CreateCatalogDialog = props => {
       propItems[0]?.value === 'filesystem' &&
       providerSelect === 'lakehouse-paimon'
     ) {
-      nextProps = propItems.filter(item => item.key !== 'uri')
+      nextProps = propItems.filter(item => !['jdbc-driver', 'jdbc-user', 
'jdbc-password', 'uri'].includes(item.key))
     }
     const parentField = nextProps.find(i => i.key === 'authentication.type')
-    if (parentField && parentField.value === 'simple') {
+    if (!parentField || parentField?.value === 'simple') {
       nextProps = nextProps.filter(
         item => item.key !== 'authentication.kerberos.principal' && item.key 
!== 'authentication.kerberos.keytab-uri'
       )
@@ -294,19 +294,19 @@ const CreateCatalogDialog = props => {
             ...others
           }
           uri && (properties['uri'] = uri)
-        } else if (
-          (!authType || authType === 'simple') &&
-          ['lakehouse-iceberg', 'lakehouse-paimon'].includes(providerSelect)
-        ) {
+        } else {
           properties = {
-            'catalog-backend': catalogBackend,
+            uri: uri,
             ...others
           }
-          uri && (properties['uri'] = uri)
-          authType && (properties['authType'] = authType)
-        } else {
-          properties = prevProperties
+          catalogBackend && (properties['catalog-backend'] = catalogBackend)
+          jdbcDriver && (properties['jdbc-driver'] = jdbcDriver)
+          jdbcUser && (properties['jdbc-user'] = jdbcUser)
+          jdbcPwd && (properties['jdbc-password'] = jdbcPwd)
         }
+        authType && (properties['authType'] = authType)
+        kerberosPrincipal && (properties['authentication.kerberos.principal'] 
= kerberosPrincipal)
+        kerberosKeytabUri && (properties['authentication.kerberos.keytab-uri'] 
= kerberosKeytabUri)
 
         const catalogData = {
           ...mainData,
diff --git a/web/web/src/lib/utils/initial.js b/web/web/src/lib/utils/initial.js
index 8629bcd18..1f3ae73ca 100644
--- a/web/web/src/lib/utils/initial.js
+++ b/web/web/src/lib/utils/initial.js
@@ -231,7 +231,6 @@ export const providers = [
         value: 'filesystem',
         defaultValue: 'filesystem',
         required: true,
-        description: 'Only supports "filesystem" now.',
         select: ['filesystem', 'hive', 'jdbc']
       },
       {
@@ -249,6 +248,14 @@ export const providers = [
         required: true,
         description: 'e.g. file:///user/hive/warehouse-paimon/ or 
hdfs://namespace/hdfs/path'
       },
+      {
+        key: 'jdbc-driver',
+        value: '',
+        required: true,
+        parentField: 'catalog-backend',
+        hide: ['hive', 'filesystem'],
+        description: `"com.mysql.jdbc.Driver" or "com.mysql.cj.jdbc.Driver" 
for MySQL, "org.postgresql.Driver" for PostgreSQL`
+      },
       {
         key: 'jdbc-user',
         value: '',

Reply via email to