diff --git a/console/src/components/forms/CreateCatalogModal.tsx b/console/src/components/forms/CreateCatalogModal.tsx index dbf220b6..e9b287a3 100644 --- a/console/src/components/forms/CreateCatalogModal.tsx +++ b/console/src/components/forms/CreateCatalogModal.tsx @@ -79,6 +79,8 @@ const schema = z // External connection (only when type === EXTERNAL) connectionType: z.enum(["ICEBERG_REST", "HADOOP", "HIVE"]).optional(), conn_uri: z.string().optional(), + conn_remoteCatalogName: z.string().optional(), + conn_warehouse: z.string().optional(), auth_type: z.enum(["OAUTH", "BEARER", "SIGV4", "IMPLICIT"]).optional(), // OAUTH oauth_tokenUri: z.string().optional(), @@ -142,6 +144,7 @@ export function CreateCatalogModal({ open, onOpenChange, onCreated }: CreateCata const storageType = watch("storageType") const catalogType = watch("type") + const connectionType = watch("connectionType") const authType = watch("auth_type") const createMutation = useMutation({ @@ -233,6 +236,14 @@ export function CreateCatalogModal({ open, onOpenChange, onCreated }: CreateCata connectionType: values.connectionType!, } if (values.conn_uri) connectionConfigInfo.uri = values.conn_uri + // Type-gated, not just presence: RHF keeps values for unmounted inputs. + if (values.connectionType === "ICEBERG_REST") { + if (values.conn_remoteCatalogName) + connectionConfigInfo.remoteCatalogName = values.conn_remoteCatalogName + } + if (values.connectionType === "HADOOP" || values.connectionType === "HIVE") { + if (values.conn_warehouse) connectionConfigInfo.warehouse = values.conn_warehouse + } if (authenticationParameters) connectionConfigInfo.authenticationParameters = authenticationParameters @@ -462,6 +473,28 @@ export function CreateCatalogModal({ open, onOpenChange, onCreated }: CreateCata

URI to the remote catalog service (if applicable).

+ {connectionType === "ICEBERG_REST" && ( + <> + +

+ Name of the catalog within the remote service. Often becomes a prefix on the + remote's REST paths. Older systems may call this the warehouse. +

+ + )} + {(connectionType === "HADOOP" || connectionType === "HIVE") && ( + <> + +

+ {connectionType === "HADOOP" + ? "The file path to where this catalog should store tables." + : "The warehouse location for the hive catalog."} +

+ + )} )} + {catalog.connectionConfigInfo.remoteCatalogName && ( +
+ + Remote Catalog Name: + + + {catalog.connectionConfigInfo.remoteCatalogName} + +
+ )} + {catalog.connectionConfigInfo.warehouse && ( +
+ Warehouse: + + {catalog.connectionConfigInfo.warehouse} + +
+ )} )} diff --git a/console/src/types/api.ts b/console/src/types/api.ts index e72d9a9f..87e53b5a 100644 --- a/console/src/types/api.ts +++ b/console/src/types/api.ts @@ -45,6 +45,10 @@ export interface ConnectionConfigInfo { uri?: string authenticationParameters?: unknown serviceIdentity?: unknown + // ICEBERG_REST-specific + remoteCatalogName?: string + // HADOOP/HIVE-specific + warehouse?: string } export interface Catalog {