Skip to content
Open
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
33 changes: 33 additions & 0 deletions console/src/components/forms/CreateCatalogModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -462,6 +473,28 @@ export function CreateCatalogModal({ open, onOpenChange, onCreated }: CreateCata
<p className="mt-1 text-xs text-muted-foreground">
URI to the remote catalog service (if applicable).
</p>
{connectionType === "ICEBERG_REST" && (
<>
<Input
placeholder="Remote catalog name (optional)"
{...register("conn_remoteCatalogName")}
/>
<p className="mt-1 text-xs text-muted-foreground">
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.
</p>
</>
)}
{(connectionType === "HADOOP" || connectionType === "HIVE") && (
<>
<Input placeholder="Warehouse (optional)" {...register("conn_warehouse")} />
<p className="mt-1 text-xs text-muted-foreground">
{connectionType === "HADOOP"
? "The file path to where this catalog should store tables."
: "The warehouse location for the hive catalog."}
</p>
</>
)}
</div>
<Controller
name="auth_type"
Expand Down
18 changes: 18 additions & 0 deletions console/src/pages/CatalogDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,24 @@ export function CatalogDetails() {
</span>
</div>
)}
{catalog.connectionConfigInfo.remoteCatalogName && (
<div className="flex gap-2 mt-2">
<span className="font-mono text-sm text-muted-foreground">
Remote Catalog Name:
</span>
<span className="font-mono text-sm">
{catalog.connectionConfigInfo.remoteCatalogName}
</span>
</div>
)}
{catalog.connectionConfigInfo.warehouse && (
<div className="flex gap-2 mt-2">
<span className="font-mono text-sm text-muted-foreground">Warehouse:</span>
<span className="font-mono text-sm">
{catalog.connectionConfigInfo.warehouse}
</span>
</div>
)}
</div>
</div>
)}
Expand Down
4 changes: 4 additions & 0 deletions console/src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down