diff --git a/packages/browser-tests/cypress/integration/console/schema.spec.js b/packages/browser-tests/cypress/integration/console/schema.spec.js index 76b8e0510..eb40aef5a 100644 --- a/packages/browser-tests/cypress/integration/console/schema.spec.js +++ b/packages/browser-tests/cypress/integration/console/schema.spec.js @@ -73,6 +73,24 @@ describe("questdb schema with working tables", () => { }); }); + it("should show the table icon description in the tooltip", () => { + cy.getByDataHook("schema-table-title") + .contains("btc_trades") + .getByDataHook("table-icon") + .realHover(); + + cy.wait(1200); + + cy.getByDataHook("tooltip").should( + "contain", + `WAL-based table, partitioned by "day", ordered on "timestamp" column.` + ); + cy.getByDataHook("tooltip").should( + "contain", + "WAL-based tables are the current and most up-to-date table format. This format supports advanced data recovery, replication and high-throughput ingestion. This is the recommended format if your table contains time-series data that has a designated timestamp." + ); + }) + it("should filter the table with input field", () => { // Table name search cy.get('input[name="table_filter"]').type("btc_trades"); diff --git a/packages/browser-tests/questdb b/packages/browser-tests/questdb index b16792dbb..4d2f4dfc2 160000 --- a/packages/browser-tests/questdb +++ b/packages/browser-tests/questdb @@ -1 +1 @@ -Subproject commit b16792dbbeea82af016921426f2b997c7dadb50c +Subproject commit 4d2f4dfc2b9ffcdbc97abc58be577dcbeccca790 diff --git a/packages/web-console/src/scenes/Schema/Row/index.tsx b/packages/web-console/src/scenes/Schema/Row/index.tsx index ca29206bf..467a8f24c 100644 --- a/packages/web-console/src/scenes/Schema/Row/index.tsx +++ b/packages/web-console/src/scenes/Schema/Row/index.tsx @@ -432,7 +432,8 @@ const Row = ({ > {isTableKind && ( diff --git a/packages/web-console/src/scenes/Schema/VirtualTables/index.tsx b/packages/web-console/src/scenes/Schema/VirtualTables/index.tsx index 6b6496d41..17b2085d4 100644 --- a/packages/web-console/src/scenes/Schema/VirtualTables/index.tsx +++ b/packages/web-console/src/scenes/Schema/VirtualTables/index.tsx @@ -375,6 +375,7 @@ const VirtualTables: FC = ({ navigateInTree={navigateInTree} partitionBy={item.partitionBy} walEnabled={item.walEnabled} + designatedTimestamp={item.designatedTimestamp} id={item.id} errors={[ ...(item.matViewData?.view_status === 'invalid' ? diff --git a/packages/web-console/src/scenes/Schema/VirtualTables/utils.ts b/packages/web-console/src/scenes/Schema/VirtualTables/utils.ts index 0c0dcacb0..d03090233 100644 --- a/packages/web-console/src/scenes/Schema/VirtualTables/utils.ts +++ b/packages/web-console/src/scenes/Schema/VirtualTables/utils.ts @@ -100,6 +100,7 @@ export const createTableNode = ( isExpanded: getSectionExpanded(tableId), partitionBy: table.partitionBy, walEnabled: table.walEnabled, + designatedTimestamp: table.designatedTimestamp, walTableData, children: [ { diff --git a/packages/web-console/src/scenes/Schema/table-icon.tsx b/packages/web-console/src/scenes/Schema/table-icon.tsx index cc08a57b2..a2db7c8f6 100644 --- a/packages/web-console/src/scenes/Schema/table-icon.tsx +++ b/packages/web-console/src/scenes/Schema/table-icon.tsx @@ -1,11 +1,15 @@ import React, { FC } from "react" import styled from "styled-components" import { Table } from "@styled-icons/remix-line" +import { PopperHover } from "../../components/PopperHover" +import { Tooltip } from "../../components/Tooltip" import { color } from '../../utils' +import * as QuestDB from "../../utils/questdb" type TableIconProps = { walEnabled?: boolean - isPartitioned?: boolean + partitionBy?: QuestDB.PartitionBy + designatedTimestamp?: string isMaterializedView?: boolean } @@ -59,15 +63,41 @@ export const MaterializedViewIcon = ({ height = "14px", width = "14px" }) => ( ) -export const TableIcon: FC = ({ walEnabled, isPartitioned, isMaterializedView }) => ( - - {isMaterializedView ? ( - - ) : ( - <> - {!walEnabled && *} - {isPartitioned ? : } - - )} - -) +export const TableIcon: FC = ({ walEnabled, partitionBy, designatedTimestamp, isMaterializedView }) => { + const isPartitioned = partitionBy && partitionBy !== "NONE" + const partitionText = isPartitioned ? `partitioned by \"${partitionBy.toLowerCase()}\"` : "unpartitioned" + const timestampText = !!designatedTimestamp ? `ordered on \"${designatedTimestamp}\" column` : "unordered" + const walText = walEnabled ? "WAL-based table" : "Legacy table format" + const fullHeader = `${walText}, ${partitionText}, ${timestampText}.` + const description = walEnabled + ? "WAL-based tables are the current and most up-to-date table format. This format supports advanced data recovery, replication and high-throughput ingestion. This is the recommended format if your table contains time-series data that has a designated timestamp." + : "Legacy table format, without WAL (write-ahead-log). This table format should only be used when table does not have timestamp column and generally not a time series. These tables are not replicated and could be slower to ingress data into." + + if (isMaterializedView) { + return ( + + + + ) + } + + return ( + + {!walEnabled && *} + {isPartitioned ?
: } + + } + delay={1000} + placement="bottom" + > + + {fullHeader} +
+
+ {description} +
+ + ) +}