From ee55241ac519552a5910174c5b98671e7f6423d8 Mon Sep 17 00:00:00 2001 From: Qian Xia Date: Mon, 28 Oct 2024 19:10:58 +0800 Subject: [PATCH 1/4] [#5318][#5311] improvement(web): Add jdbc-driver properties for Paimon JDBC, fix(web): fix update pamon catalog --- .../metalake/rightContent/CreateCatalogDialog.js | 14 +++----------- web/web/src/lib/utils/initial.js | 8 ++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js b/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js index 4cb41e6fb8b..2f7a7207fa8 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' ) @@ -288,21 +288,13 @@ const CreateCatalogDialog = props => { uri: uri, ...others } + authType && (properties['authType'] = authType) } else if (catalogBackend && catalogBackend === 'filesystem' && providerSelect === 'lakehouse-paimon') { properties = { 'catalog-backend': catalogBackend, ...others } uri && (properties['uri'] = uri) - } else if ( - (!authType || authType === 'simple') && - ['lakehouse-iceberg', 'lakehouse-paimon'].includes(providerSelect) - ) { - properties = { - 'catalog-backend': catalogBackend, - ...others - } - uri && (properties['uri'] = uri) authType && (properties['authType'] = authType) } else { properties = prevProperties diff --git a/web/web/src/lib/utils/initial.js b/web/web/src/lib/utils/initial.js index 3517ecd2ecd..bb17a8b42af 100644 --- a/web/web/src/lib/utils/initial.js +++ b/web/web/src/lib/utils/initial.js @@ -249,6 +249,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: '', From 30492c4b653c1b87ffced52f07bf660c1630d218 Mon Sep 17 00:00:00 2001 From: Qian Xia Date: Tue, 29 Oct 2024 15:08:30 +0800 Subject: [PATCH 2/4] refine jdbc configuration --- .../metalake/rightContent/CreateCatalogDialog.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js b/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js index 2f7a7207fa8..2deadcad31c 100644 --- a/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js +++ b/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js @@ -288,17 +288,25 @@ const CreateCatalogDialog = props => { uri: uri, ...others } - authType && (properties['authType'] = authType) } else if (catalogBackend && catalogBackend === 'filesystem' && providerSelect === 'lakehouse-paimon') { properties = { 'catalog-backend': catalogBackend, ...others } uri && (properties['uri'] = uri) - authType && (properties['authType'] = authType) } else { - properties = prevProperties + properties = { + 'catalog-backend': catalogBackend, + 'jdbc-driver': jdbcDriver, + 'jdbc-user': jdbcUser, + 'jdbc-password': jdbcPwd, + uri: uri, + ...others + } } + authType && (properties['authType'] = authType) + kerberosPrincipal && (properties['authentication.kerberos.principal'] = kerberosPrincipal) + kerberosKeytabUri && (properties['authentication.kerberos.keytab-uri'] = kerberosKeytabUri) const catalogData = { ...mainData, From 84a08b267127b4eec033cec0190aa51f6013f3d0 Mon Sep 17 00:00:00 2001 From: Qian Xia Date: Tue, 29 Oct 2024 16:28:40 +0800 Subject: [PATCH 3/4] refine paimon description --- web/web/src/lib/utils/initial.js | 1 - 1 file changed, 1 deletion(-) diff --git a/web/web/src/lib/utils/initial.js b/web/web/src/lib/utils/initial.js index bb17a8b42af..ba43f8285b6 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'] }, { From 3b2f19a50ebc5d72ffe6e38668bf48bb7a751825 Mon Sep 17 00:00:00 2001 From: Qian Xia Date: Tue, 29 Oct 2024 17:06:51 +0800 Subject: [PATCH 4/4] refine paimon jdbc properties --- .../metalake/rightContent/CreateCatalogDialog.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js b/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js index 2deadcad31c..34db30698d9 100644 --- a/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js +++ b/web/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js @@ -296,13 +296,13 @@ const CreateCatalogDialog = props => { uri && (properties['uri'] = uri) } else { properties = { - 'catalog-backend': catalogBackend, - 'jdbc-driver': jdbcDriver, - 'jdbc-user': jdbcUser, - 'jdbc-password': jdbcPwd, uri: uri, ...others } + 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)