Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4742] Improvement(ui): support creating paimon catalog #4917

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading