Freigeben über


Erste Schritte mit OneLake-Tabellen-APIs für Delta

OneLake bietet einen REST-API-Endpunkt für die Interaktion mit Tabellen in Microsoft Fabric. Dieser Endpunkt unterstützt schreibgeschützte Metadatenvorgänge für Delta-Tabellen in Fabric. Diese Vorgänge sind mit dem offenen Standard der Unity-Katalog-API kompatibel.

Von Bedeutung

Dieses Feature befindet sich in der Vorschauphase.

Beispielanforderungen und -antworten

Diese Beispielanforderungen und -antworten veranschaulichen die Verwendung der delta-API-Vorgänge, die derzeit am OneLake-Tabellen-API-Endpunkt unterstützt werden.

Für jeden dieser Vorgänge:

  • <BaseUrl> ist https://onelake.table.fabric.microsoft.com/delta
  • <Workspace>/DataItem > kann sein:
    • <WorkspaceID>/<DataItemID>, wie zum Beispiel 12345678-abcd-4fbd-9e50-3937d8eb1915/98765432-dcba-4209-8ac2-0821c7f8bd91
    • <WorkspaceName>/<DataItemName>.<DataItemType>, wie MyWorkspace/MyItem.Lakehouse, solange beide Namen keine Sonderzeichen enthalten
      Zeichen.
  • <Token> ist der Zugriffstokenwert, der von der Microsoft Entra-ID bei erfolgreicher Authentifizierung zurückgegeben wird.

Listenschemas

Schemas innerhalb eines Fabric-Datenelements auflisten.

  • Anforderung
curl -X GET \
  "<BaseUrl>/<Workspace>/testlh.Lakehouse/api/2.1/unity-catalog/schemas?catalog_name=testlh.Lakehouse" \
  -H "Authorization: Bearer <Token>" \
  -H "Content-Type: application/json"
  • Antwort
200 OK
{
"schemas": [
	{
		"name": "dbo",
		"catalog_name": "testlh.Lakehouse",
        "full_name": "testlh.Lakehouse.dbo",
		"created_at": 1759768029062,
		"updated_at": 1759768029062,
		"comment": null,
		"properties": null,
		"owner": null,
		"created_by": null,
		"updated_by": null,
		"schema_id": null
	}
],
"next_page_token": null
}

Tabellen auflisten

Listen Sie Tabellen innerhalb eines bestimmten Schemas auf.

  • Anforderung
curl -X GET \
  "<BaseUrl>/<Workspace>/testlh.Lakehouse/api/2.1/unity-catalog/tables?catalog_name=testlh.Lakehouse&schema_name=dbo" \
  -H "Authorization: Bearer <Token>" \
  -H "Content-Type: application/json"
  • Antwort
200 OK
{
"tables": [
    {
        "name": "product_table",
        "catalog_name": "testlh.Lakehouse",
        "schema_name": "dbo",
        "table_type": null,
        "data_source_format": "DELTA",
        "columns": null,
        "storage_location": "https://onelake.dfs.fabric.microsoft.com/.../.../Tables/product_table",
        "comment": null,
        "properties": null,
        "owner": null,
        "created_at": null,
        "created_by": null,
        "updated_at": null,
        "updated_by": null,
        "table_id": null
    }
],
"next_page_token": null
}

Tabelle abrufen

Dient zum Abrufen von Tabellendetails für eine bestimmte Tabelle.

Anforderung

curl -X GET \
  "<BaseUrl>/<Workspace>/testlh.Lakehouse/api/2.1/unity-catalog/tables/testlh.Lakehouse.dbo.product_table" \
  -H "Authorization: Bearer <Token>" \
  -H "Content-Type: application/json"

Antwort

    200 OK
    {
	"name": "product_table",
	"catalog_name": "testlh.Lakehouse",
	"schema_name": "dbo",
	"table_type": null,
	"data_source_format": "DELTA",
	"columns": [
		{
			"name": "product_id",
			"type_text": null,
			"type_json": null,
			"type_name": "string",
			"type_precision": 0,
			"type_scale": 0,
			"type_interval_type": null,
			"comment": null,
			"partition_index": 0,
			"position": 0,
			"nullable": true
		},
		{
			"name": "product_name",
			"type_text": null,
			"type_json": null,
			"type_name": "string",
			"type_precision": 0,
			"type_scale": 0,
			"type_interval_type": null,
			"comment": null,
			"partition_index": 0,
			"position": 1,
			"nullable": true
		},
		{
			"name": "category",
			"type_text": null,
			"type_json": null,
			"type_name": "string",
			"type_precision": 0,
			"type_scale": 0,
			"type_interval_type": null,
			"comment": null,
			"partition_index": 0,
			"position": 2,
			"nullable": true
		},
		{
			"name": "brand",
			"type_text": null,
			"type_json": null,
			"type_name": "string",
			"type_precision": 0,
			"type_scale": 0,
			"type_interval_type": null,
			"comment": null,
			"partition_index": 0,
			"position": 3,
			"nullable": true
		},
		{
			"name": "price",
			"type_text": null,
			"type_json": null,
			"type_name": "double",
			"type_precision": 0,
			"type_scale": 0,
			"type_interval_type": null,
			"comment": null,
			"partition_index": 0,
			"position": 4,
			"nullable": true
		},
		{
			"name": "launch_date",
			"type_text": null,
			"type_json": null,
			"type_name": "date",
			"type_precision": 0,
			"type_scale": 0,
			"type_interval_type": null,
			"comment": null,
			"partition_index": 0,
			"position": 5,
			"nullable": true
		}
	],
	"storage_location": "https://onelake.dfs.fabric.microsoft.com/.../.../Tables/product_table",
	"comment": null,
	"properties": null,
	"owner": null,
	"created_at": 1759703452000,
	"created_by": null,
	"updated_at": 1759703452000,
	"updated_by": null,
	"table_id": "df2b3038-c21a-429d-90b8-f3bbf2d3db5d"
    }