Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#2861][#2963][#2974] improve(web): add table properties and fileset fields displaying (#2972)

CHEYNEe357f38d3ae6
diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/CatalogsPageTest.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/CatalogsPageTest.java
index 936bd17a15..466500447c 100644
--- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/CatalogsPageTest.java
+++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/CatalogsPageTest.java
@@ -296,7 +296,7 @@ public class CatalogsPageTest extends AbstractWebIT {
public void testClickCatalogLink() {
catalogsPage.clickCatalogLink(METALAKE_NAME, MODIFIED_CATALOG_NAME, CATALOG_TYPE);
Assertions.assertTrue(catalogsPage.verifyShowTableTitle(CATALOG_TABLE_TITLE));
- Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(SCHEMA_NAME));
+ Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(SCHEMA_NAME, false));
Assertions.assertTrue(catalogsPage.verifySelectedNode(MODIFIED_CATALOG_NAME));
}
@@ -306,7 +306,7 @@ public class CatalogsPageTest extends AbstractWebIT {
driver.navigate().refresh();
Assertions.assertEquals(driver.getTitle(), WEB_TITLE);
Assertions.assertTrue(catalogsPage.verifyShowTableTitle(CATALOG_TABLE_TITLE));
- Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(SCHEMA_NAME));
+ Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(SCHEMA_NAME, false));
List<String> treeNodes =
Arrays.asList(
MODIFIED_CATALOG_NAME,
@@ -329,7 +329,7 @@ public class CatalogsPageTest extends AbstractWebIT {
METALAKE_NAME, MODIFIED_CATALOG_NAME, SCHEMA_NAME, TABLE_NAME, COLUMN_NAME);
catalogsPage.clickSchemaLink(METALAKE_NAME, MODIFIED_CATALOG_NAME, CATALOG_TYPE, SCHEMA_NAME);
Assertions.assertTrue(catalogsPage.verifyShowTableTitle(SCHEMA_TABLE_TITLE));
- Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(TABLE_NAME));
+ Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(TABLE_NAME, false));
Assertions.assertTrue(catalogsPage.verifySelectedNode(SCHEMA_NAME));
}
@@ -339,7 +339,7 @@ public class CatalogsPageTest extends AbstractWebIT {
driver.navigate().refresh();
Assertions.assertEquals(driver.getTitle(), WEB_TITLE);
Assertions.assertTrue(catalogsPage.verifyShowTableTitle(SCHEMA_TABLE_TITLE));
- Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(TABLE_NAME));
+ Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(TABLE_NAME, false));
List<String> treeNodes =
Arrays.asList(
MODIFIED_CATALOG_NAME,
@@ -362,7 +362,7 @@ public class CatalogsPageTest extends AbstractWebIT {
METALAKE_NAME, MODIFIED_CATALOG_NAME, CATALOG_TYPE, SCHEMA_NAME, TABLE_NAME);
Assertions.assertTrue(catalogsPage.verifyShowTableTitle(TABLE_TABLE_TITLE));
Assertions.assertTrue(catalogsPage.verifyTableColumns());
- Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(COLUMN_NAME));
+ Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(COLUMN_NAME, true));
Assertions.assertTrue(catalogsPage.verifySelectedNode(TABLE_NAME));
}
@@ -374,7 +374,7 @@ public class CatalogsPageTest extends AbstractWebIT {
Assertions.assertTrue(catalogsPage.verifyRefreshPage());
Assertions.assertTrue(catalogsPage.verifyShowTableTitle(TABLE_TABLE_TITLE));
Assertions.assertTrue(catalogsPage.verifyTableColumns());
- Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(COLUMN_NAME));
+ Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(COLUMN_NAME, true));
List<String> treeNodes =
Arrays.asList(
MODIFIED_CATALOG_NAME,
@@ -428,14 +428,14 @@ public class CatalogsPageTest extends AbstractWebIT {
METALAKE_NAME, MODIFIED_CATALOG_NAME, CATALOG_TYPE, SCHEMA_NAME);
catalogsPage.clickTreeNode(schemaNode);
Assertions.assertTrue(catalogsPage.verifyShowTableTitle(SCHEMA_TABLE_TITLE));
- Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(TABLE_NAME));
+ Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(TABLE_NAME, false));
String tableNode =
String.format(
"{{%s}}{{%s}}{{%s}}{{%s}}{{%s}}",
METALAKE_NAME, MODIFIED_CATALOG_NAME, CATALOG_TYPE, SCHEMA_NAME, TABLE_NAME);
catalogsPage.clickTreeNode(tableNode);
Assertions.assertTrue(catalogsPage.verifyShowTableTitle(TABLE_TABLE_TITLE));
- Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(COLUMN_NAME));
+ Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(COLUMN_NAME, true));
Assertions.assertTrue(catalogsPage.verifyTableColumns());
}
@@ -458,7 +458,7 @@ public class CatalogsPageTest extends AbstractWebIT {
METALAKE_NAME, MODIFIED_CATALOG_NAME, CATALOG_TYPE, SCHEMA_NAME, TABLE_NAME_2);
catalogsPage.clickTreeNode(tableNode);
Assertions.assertTrue(catalogsPage.verifyShowTableTitle(TABLE_TABLE_TITLE));
- Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(COLUMN_NAME_2));
+ Assertions.assertTrue(catalogsPage.verifyShowDataItemInList(COLUMN_NAME_2, true));
Assertions.assertTrue(catalogsPage.verifyTableColumns());
}
diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/pages/CatalogsPage.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/pages/CatalogsPage.java
index 17b9c2d6aa..8f8c1a73a2 100644
--- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/pages/CatalogsPage.java
+++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/pages/CatalogsPage.java
@@ -450,13 +450,15 @@ public class CatalogsPage extends AbstractWebIT {
}
}
- public boolean verifyShowDataItemInList(String itemName) {
+ public boolean verifyShowDataItemInList(String itemName, Boolean isColumnLevel) {
try {
Thread.sleep(ACTION_SLEEP_MILLIS);
- List<WebElement> list =
- driver.findElements(
- By.xpath(
- "//div[@data-refer='table-grid']//div[contains(@class, 'MuiDataGrid-main')]/div[contains(@class, 'MuiDataGrid-virtualScroller')]/div/div[@role='rowgroup']//div[@data-field='name']"));
+ String xpath =
+ "//div[@data-refer='table-grid']//div[contains(@class, 'MuiDataGrid-main')]/div[contains(@class, 'MuiDataGrid-virtualScroller')]/div/div[@role='rowgroup']//div[@data-field='name']";
+ if (isColumnLevel) {
+ xpath = xpath + "//p";
+ }
+ List<WebElement> list = driver.findElements(By.xpath(xpath));
List<String> texts = new ArrayList<>();
for (WebElement element : list) {
texts.add(element.getText());
diff --git a/web/src/app/login/page.js b/web/src/app/login/page.js
index 7ba6510ff4..d6efd0eff7 100644
--- a/web/src/app/login/page.js
+++ b/web/src/app/login/page.js
@@ -62,7 +62,12 @@ const LoginPage = () => {
<Card sx={{ width: 480 }}>
<CardContent className={`twc-p-12`}>
<Box className={`twc-mb-8 twc-flex twc-items-center twc-justify-center`}>
- <Image src={'/icons/gravitino.svg'} width={24} height={24} alt='logo' />
+ <Image
+ src={`${process.env.NEXT_PUBLIC_BASE_PATH}/icons/gravitino.svg`}
+ width={24}
+ height={24}
+ alt='logo'
+ />
<Typography variant='h6' className={`twc-ml-2 twc-font-semibold twc-text-[1.5rem] logoText`}>
Gravitino
</Typography>
diff --git a/web/src/app/metalakes/metalake/MetalakeTree.js b/web/src/app/metalakes/metalake/MetalakeTree.js
index 0b880448d9..5814168429 100644
--- a/web/src/app/metalakes/metalake/MetalakeTree.js
+++ b/web/src/app/metalakes/metalake/MetalakeTree.js
@@ -58,6 +58,7 @@ const MetalakeTree = props => {
case 'messaging':
return 'skill-icons:kafka'
case 'fileset':
+ return 'twemoji:file-folder'
default:
return 'bx:book'
}
@@ -70,7 +71,7 @@ const MetalakeTree = props => {
case 'table': {
if (store.selectedNodes.includes(nodeProps.data.key)) {
const pathArr = extractPlaceholder(nodeProps.data.key)
- const [metalake, catalog, schema, table] = pathArr
+ const [metalake, catalog, type, schema, table] = pathArr
dispatch(getTableDetails({ init: true, metalake, catalog, schema, table }))
}
break
@@ -263,6 +264,7 @@ const MetalakeTree = props => {
useEffect(() => {
dispatch(setExpandedNodes(store.expandedNodes))
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [store.metalakeTree, dispatch])
return (
diff --git a/web/src/app/metalakes/metalake/rightContent/tabsContent/TabsContent.js b/web/src/app/metalakes/metalake/rightContent/tabsContent/TabsContent.js
index f7dfb7b043..699d3bf069 100644
--- a/web/src/app/metalakes/metalake/rightContent/tabsContent/TabsContent.js
+++ b/web/src/app/metalakes/metalake/rightContent/tabsContent/TabsContent.js
@@ -5,20 +5,24 @@
'use client'
+import { Inconsolata } from 'next/font/google'
+
import { useState, useEffect } from 'react'
-import Box from '@mui/material/Box'
-import Tab from '@mui/material/Tab'
-import TabContext from '@mui/lab/TabContext'
-import TabList from '@mui/lab/TabList'
-import TabPanel from '@mui/lab/TabPanel'
-import Typography from '@mui/material/Typography'
+import { styled, Box, Divider, List, ListItem, ListItemText, Stack, Tab, Typography } from '@mui/material'
+import Tooltip, { tooltipClasses } from '@mui/material/Tooltip'
+import { TabContext, TabList, TabPanel } from '@mui/lab'
+
+import { useAppSelector } from '@/lib/hooks/useStore'
+
import { useSearchParams } from 'next/navigation'
import TableView from './tableView/TableView'
import DetailsView from './detailsView/DetailsView'
import Icon from '@/components/Icon'
+const fonts = Inconsolata({ subsets: ['latin'] })
+
const CustomTab = props => {
const { icon, label, value, ...others } = props
@@ -38,6 +42,16 @@ const CustomTab = props => {
)
}
+const CustomTooltip = styled(({ className, ...props }) => <Tooltip {...props} classes={{ popper: className }} />)(
+ ({ theme }) => ({
+ [`& .${tooltipClasses.tooltip}`]: {
+ backgroundColor: '#23282a',
+ padding: 0,
+ border: '1px solid #dadde9'
+ }
+ })
+)
+
const CustomTabPanel = props => {
const { value, children, ...others } = props
@@ -50,11 +64,13 @@ const CustomTabPanel = props => {
const TabsContent = () => {
let tableTitle = ''
+ const store = useAppSelector(state => state.metalakes)
const searchParams = useSearchParams()
const paramsSize = [...searchParams.keys()].length
const type = searchParams.get('type')
const [tab, setTab] = useState('table')
const isNotNeedTableTab = type && ['fileset', 'messaging'].includes(type) && paramsSize === 5
+ const isShowTableProps = paramsSize === 5 && !['fileset', 'messaging'].includes(type)
const handleChangeTab = (event, newValue) => {
setTab(newValue)
@@ -98,13 +114,118 @@ const TabsContent = () => {
return (
<TabContext value={tab}>
- <Box sx={{ px: 6, py: 2, borderBottom: 1, borderColor: 'divider' }}>
- <TabList onChange={handleChangeTab} aria-label='tabs'>
+ <Box
+ sx={{
+ px: 6,
+ py: 2,
+ borderBottom: 1,
+ borderColor: 'divider',
+ display: 'flex',
+ justifyContent: 'space-between',
+ alignItems: 'center'
+ }}
+ >
+ <TabList onChange={handleChangeTab} aria-label='tabs' variant='scrollable' scrollButtons='auto'>
{!isNotNeedTableTab ? (
<CustomTab icon='mdi:list-box-outline' label={tableTitle} value='table' data-refer='tab-table' />
) : null}
<CustomTab icon='mdi:clipboard-text-outline' label='Details' value='details' data-refer='tab-details' />
</TabList>
+ {isShowTableProps && (
+ <Box>
+ <List dense sx={{ p: 0 }}>
+ <Stack spacing={0} direction={'row'} divider={<Divider orientation='vertical' flexItem />}>
+ {store.tableProps
+ .filter(i => i.items.length !== 0)
+ .map((item, index) => {
+ return (
+ <CustomTooltip
+ key={item.type}
+ title={
+ <>
+ <Box
+ sx={{
+ backgroundColor: '#525c61',
+ p: 1.5,
+ px: 4,
+ borderTopLeftRadius: 4,
+ borderTopRightRadius: 4
+ }}
+ >
+ <Typography
+ color='white'
+ fontWeight={700}
+ fontSize={14}
+ sx={{ textTransform: 'capitalize' }}
+ >
+ {item.type}:{' '}
+ </Typography>
+ </Box>
+
+ <Box sx={{ p: 1.5, px: 4 }}>
+ {item.items.map(i => {
+ return (
+ <Typography key={i} variant='caption' color='white' className={fonts.className}>
+ {item.type === 'sortOrders' ? i.text : i.fields}
+ </Typography>
+ )
+ })}
+ </Box>
+ </>
+ }
+ >
+ <ListItem sx={{ maxWidth: 140, py: 0 }}>
+ <ListItemText
+ sx={{ m: 0 }}
+ primary={
+ <Box
+ sx={{
+ display: 'flex',
+ alignItems: 'center',
+ color: theme => theme.palette.text.primary
+ }}
+ >
+ <Typography
+ component={'span'}
+ textTransform={'capitalize'}
+ fontWeight={700}
+ fontSize={14}
+ sx={{ display: 'inline-block', pr: 2 }}
+ >
+ {item.type}
+ </Typography>{' '}
+ <Box sx={{ display: 'flex', alignItems: 'center' }}>
+ <Icon icon={item.icon} />
+ </Box>
+ </Box>
+ }
+ secondary={
+ <Box
+ component={'span'}
+ sx={{
+ display: 'inline-block',
+ width: '100%',
+ overflow: 'hidden',
+ whiteSpace: 'nowrap',
+ textOverflow: 'ellipsis'
+ }}
+ >
+ <Typography variant='caption' className={fonts.className}>
+ {item.type === 'sortOrders'
+ ? item.items.map(i => i.text)
+ : item.items.map(i => i.fields)}
+ </Typography>
+ </Box>
+ }
+ />
+ </ListItem>
+ </CustomTooltip>
+ )
+ })}
+ </Stack>
+ </List>
+ </Box>
+ )}
</Box>
{!isNotNeedTableTab ? (
<CustomTabPanel value='table' data-refer='tab-table-panel'>
diff --git a/web/src/app/metalakes/metalake/rightContent/tabsContent/detailsView/DetailsView.js b/web/src/app/metalakes/metalake/rightContent/tabsContent/detailsView/DetailsView.js
index fb04dc8186..a15b287a25 100644
--- a/web/src/app/metalakes/metalake/rightContent/tabsContent/detailsView/DetailsView.js
+++ b/web/src/app/metalakes/metalake/rightContent/tabsContent/detailsView/DetailsView.js
@@ -73,6 +73,22 @@ const DetailsView = () => {
</Grid>
</>
) : null}
+ {paramsSize === 5 && searchParams.get('fileset') ? (
+ <>
+ <Grid item xs={12} sx={{ mb: [0, 5] }}>
+ <Typography variant='body2' sx={{ mb: 2 }}>
+ Type
+ </Typography>
+ {renderFieldText({ value: activatedItem?.type })}
+ </Grid>
+ <Grid item xs={12} sx={{ mb: [0, 5] }}>
+ <Typography variant='body2' sx={{ mb: 2 }}>
+ Storage location
+ </Typography>
+ {renderFieldText({ value: activatedItem?.storageLocation })}
+ </Grid>
+ </>
+ ) : null}
<Grid item xs={12} sx={{ mb: [0, 5] }}>
<Typography variant='body2' sx={{ mb: 2 }}>
Comment
diff --git a/web/src/app/metalakes/metalake/rightContent/tabsContent/tableView/TableView.js b/web/src/app/metalakes/metalake/rightContent/tabsContent/tableView/TableView.js
index 4c0ee996f5..1074e86aa4 100644
--- a/web/src/app/metalakes/metalake/rightContent/tabsContent/tableView/TableView.js
+++ b/web/src/app/metalakes/metalake/rightContent/tabsContent/tableView/TableView.js
@@ -5,11 +5,14 @@
'use client'
+import { Inconsolata } from 'next/font/google'
+
import { useState, useEffect } from 'react'
import Link from 'next/link'
-import { Box, Typography, IconButton } from '@mui/material'
+import { styled, Box, Typography, IconButton, Stack } from '@mui/material'
+import Tooltip, { tooltipClasses } from '@mui/material/Tooltip'
import { DataGrid } from '@mui/x-data-grid'
import {
VisibilityOutlined as ViewIcon,
@@ -17,6 +20,8 @@ import {
DeleteOutlined as DeleteIcon
} from '@mui/icons-material'
+import Icon from '@/components/Icon'
+
import ColumnTypeChip from '@/components/ColumnTypeChip'
import DetailsDrawer from '@/components/DetailsDrawer'
import ConfirmDeleteDialog from '@/components/ConfirmDeleteDialog'
@@ -29,6 +34,8 @@ import { to } from '@/lib/utils'
import { getCatalogDetailsApi } from '@/lib/api/catalogs'
import { useSearchParams } from 'next/navigation'
+const fonts = Inconsolata({ subsets: ['latin'] })
+
const EmptyText = () => {
return (
<Typography variant='caption' color={theme => theme.palette.text.disabled}>
@@ -37,6 +44,16 @@ const EmptyText = () => {
)
}
+const CustomTooltip = styled(({ className, ...props }) => <Tooltip {...props} classes={{ popper: className }} />)(
+ ({ theme }) => ({
+ [`& .${tooltipClasses.tooltip}`]: {
+ backgroundColor: '#23282a',
+ padding: 0,
+ border: '1px solid #dadde9'
+ }
+ })
+)
+
const TableView = () => {
const searchParams = useSearchParams()
const paramsSize = [...searchParams.keys()].length
@@ -64,6 +81,56 @@ const TableView = () => {
}
}
+ const renderIconTooltip = (type, name) => {
+ const propsItem = store.tableProps.find(i => i.type === type)
+ const items = propsItem?.items || []
+
+ const isCond = propsItem?.items.find(i => i.fields.find(v => (Array.isArray(v) ? v.includes(name) : v === name)))
+
+ const icon = propsItem?.icon
+
+ return (
+ <>
+ {isCond && (
+ <CustomTooltip
+ placement='right'
+ title={
+ <>
+ <Box
+ sx={{
+ backgroundColor: '#525c61',
+ p: 1.5,
+ px: 4,
+ borderTopLeftRadius: 4,
+ borderTopRightRadius: 4
+ }}
+ >
+ <Typography color='white' fontWeight={700} fontSize={14} sx={{ textTransform: 'capitalize' }}>
+ {type}:{' '}
+ </Typography>
+ </Box>
+
+ <Box sx={{ p: 1.5, px: 4 }}>
+ {items.map(i => {
+ return (
+ <Typography key={i} variant='caption' color='white' className={fonts.className}>
+ {i.text || i.fields}
+ </Typography>
+ )
+ })}
+ </Box>
+ </>
+ }
+ >
+ <Box sx={{ display: 'flex', alignItems: 'center' }}>
+ <Icon icon={icon} />
+ </Box>
+ </CustomTooltip>
+ )}
+ </>
+ )
+ }
+
const columns = [
{
flex: 0.1,
@@ -182,7 +249,7 @@ const TableView = () => {
const tableColumns = [
{
- flex: 0.1,
+ flex: 0.15,
minWidth: 60,
disableColumnMenu: true,
type: 'string',
@@ -197,6 +264,7 @@ const TableView = () => {
title={name}
noWrap
sx={{
+ pr: 4,
fontWeight: 400,
color: 'text.main',
textDecoration: 'none'
@@ -204,6 +272,12 @@ const TableView = () => {
>
{name}
</Typography>
+ <Stack spacing={0} direction={'row'}>
+ {renderIconTooltip('partitioning', name)}
+ {renderIconTooltip('sortOrders', name)}
+ {renderIconTooltip('distribution', name)}
+ {renderIconTooltip('indexes', name)}
+ </Stack>
</Box>
)
}
diff --git a/web/src/lib/store/metalakes/index.js b/web/src/lib/store/metalakes/index.js
index 912f7bac8a..eeba3508a4 100644
--- a/web/src/lib/store/metalakes/index.js
+++ b/web/src/lib/store/metalakes/index.js
@@ -600,6 +600,94 @@ export const getTableDetails = createAsyncThunk(
const { table: resTable } = res
+ const { distribution, sortOrders = [], partitioning = [], indexes = [] } = resTable
+
+ const tableProps = [
+ {
+ type: 'partitioning',
+ icon: 'tabler:circle-letter-p-filled',
+ items: partitioning.map(i => {
+ let fields = i.fieldName || []
+ let sub = ''
+ let last = i.fieldName.join('.')
+
+ switch (i.strategy) {
+ case 'bucket':
+ sub = `[${i.numBuckets}]`
+ fields = i.fieldNames
+ last = i.fieldNames.map(v => v[0]).join(',')
+ break
+ case 'truncate':
+ sub = `[${i.width}]`
+ break
+ case 'list':
+ fields = i.fieldNames
+ last = i.fieldNames.map(v => v[0]).join(',')
+ break
+ case 'function':
+ sub = `[${i.funcName}]`
+ fields = i.funcArgs.map(v => v.fieldName)
+ last = fields.join(',')
+ break
+ default:
+ break
+ }
+
+ return {
+ strategy: i.strategy,
+ numBuckets: i.numBuckets,
+ width: i.width,
+ funcName: i.funcName,
+ fields,
+ text: `${i.strategy}${sub}(${last})`
+ }
+ })
+ },
+ {
+ type: 'sortOrders',
+ icon: 'mdi:letter-s-circle',
+ items: sortOrders.map(i => {
+ return {
+ fields: i.sortTerm.fieldName,
+ dir: i.direction,
+ no: i.nullOrdering,
+ text: `${i.sortTerm.fieldName[0]} ${i.direction} ${i.nullOrdering}`
+ }
+ })
+ },
+ {
+ type: 'distribution',
+ icon: 'tabler:circle-letter-d-filled',
+ items: distribution.funcArgs.map(i => {
+ return {
+ fields: i.fieldName,
+ number: distribution.number,
+ strategy: distribution.strategy,
+ text:
+ distribution.strategy === ''
+ ? ``
+ : `${distribution.strategy}${
+ distribution.number === 0 ? '' : `[${distribution.number}]`
+ }(${i.fieldName.join(',')})`
+ }
+ })
+ },
+ {
+ type: 'indexes',
+ icon: 'mdi:letter-i-circle',
+ items: indexes.map(i => {
+ return {
+ fields: i.fieldNames,
+ name: i.name,
+ indexType: i.indexType,
+ text: `${i.name}(${i.fieldNames.join(',')})`
+ }
+ })
+ }
+ ]
+
+ dispatch(setTableProps(tableProps))
+
if (getState().metalakes.metalakeTree.length === 0) {
dispatch(fetchCatalogs({ metalake }))
}
@@ -818,6 +906,7 @@ export const appMetalakesSlice = createSlice({
metalakes: [],
filteredMetalakes: [],
tableData: [],
+ tableProps: [],
catalogs: [],
schemas: [],
tables: [],
@@ -870,6 +959,7 @@ export const appMetalakesSlice = createSlice({
state.loadedNodes = []
state.tableData = []
+ state.tableProps = []
state.catalogs = []
state.schemas = []
state.tables = []
@@ -898,6 +988,9 @@ export const appMetalakesSlice = createSlice({
removeCatalogFromTree(state, action) {
state.metalakeTree = state.metalakeTree.filter(i => i.key !== action.payload)
},
+ setTableProps(state, action) {
+ state.tableProps = action.payload
+ },
resetMetalakeStore(state, action) {}
},
extraReducers: builder => {
@@ -1032,7 +1125,8 @@ export const {
setExpanded,
setExpandedNodes,
addCatalogToTree,
- removeCatalogFromTree
+ removeCatalogFromTree,
+ setTableProps
} = appMetalakesSlice.actions
export default appMetalakesSlice.reducer