Skip to content

Commit

Permalink
[#4742] Improvement(ui): support creating paimon catalog (#4917)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
support creating paimon catalog
<img width="606" alt="image"
src="https://github.com/user-attachments/assets/e60ee53b-018d-4f0d-a49b-4e5145c74f8e">
<img width="641" alt="image"
src="https://github.com/user-attachments/assets/3bf2a40c-d5a0-41f1-8b4d-a7fbde221fee">


### Why are the changes needed?
support paimon by 0.6.0 version

Fix: #4742

### Does this PR introduce _any_ user-facing change?
N/A

### How was this patch tested?
N/A
  • Loading branch information
LauraXia123 authored Sep 13, 2024
1 parent 23f7f4c commit ff84056
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 13 deletions.
2 changes: 2 additions & 0 deletions web/web/src/app/metalakes/metalake/MetalakeTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ const MetalakeTree = props => {
return 'devicon:postgresql-wordmark'
case 'jdbc-doris':
return 'custom-icons-doris'
case 'lakehouse-paimon':
return 'custom-icons-paimon'
default:
return 'bx:book'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,11 @@ const CreateCatalogDialog = props => {
if (!field) {
return true
}
const parentField = innerProps.find(i => i.key === 'catalog-backend')
const check = parentField && parentField.value === field.hide
const parentField = innerProps.find(i => i.key === field.parentField)

const check =
(parentField && parentField.value === field.hide) ||
(field.parentField === 'authentication.type' && parentField === undefined)

return check
}
Expand All @@ -189,9 +192,7 @@ const CreateCatalogDialog = props => {
const resetPropsFields = (providers = [], index = -1) => {
if (index !== -1) {
providers[index].defaultProps.forEach((item, index) => {
if (item.key !== 'catalog-backend') {
item.value = ''
}
item.value = item.defaultValue || ''
})
}
}
Expand Down Expand Up @@ -226,12 +227,26 @@ const CreateCatalogDialog = props => {

const { propItems, ...mainData } = data

let nextProps = []

if (propItems[0]?.key === 'catalog-backend' && propItems[0]?.value === 'hive') {
nextProps = propItems.slice(0, 3)
} else {
nextProps = propItems
let nextProps = propItems

if (
propItems[0]?.key === 'catalog-backend' &&
propItems[0]?.value === 'hive' &&
providerSelect === 'lakehouse-iceberg'
) {
nextProps = propItems.filter(item => !['jdbc-driver', 'jdbc-user', 'jdbc-password'].includes(item.key))
} else if (
propItems[0]?.key === 'catalog-backend' &&
propItems[0]?.value === 'filesystem' &&
providerSelect === 'lakehouse-paimon'
) {
nextProps = propItems.filter(item => item.key !== 'uri')
}
const parentField = nextProps.find(i => i.key === 'authentication.type')
if (parentField && parentField.value === 'simple') {
nextProps = nextProps.filter(
item => item.key !== 'authentication.kerberos.principal' && item.key !== 'authentication.kerberos.keytab-uri'
)
}

trigger()
Expand All @@ -256,14 +271,35 @@ const CreateCatalogDialog = props => {
'jdbc-driver': jdbcDriver,
'jdbc-user': jdbcUser,
'jdbc-password': jdbcPwd,
uri: uri,
'authentication.type': authType,
'authentication.kerberos.principal': kerberosPrincipal,
'authentication.kerberos.keytab-uri': kerberosKeytabUri,
...others
} = prevProperties

if (catalogBackend && catalogBackend === 'hive') {
if (catalogBackend && catalogBackend === 'hive' && providerSelect === 'lakehouse-iceberg') {
properties = {
'catalog-backend': catalogBackend,
uri: uri,
...others
}
} 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
}
Expand Down
7 changes: 6 additions & 1 deletion web/web/src/lib/icons/iconify-icons.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions web/web/src/lib/icons/svg/paimon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ff84056

Please sign in to comment.