แชร์ผ่าน


เริ่มต้นใช้งาน OneLake table API สําหรับเดลต้า

OneLake มีจุดสิ้นสุด REST API สําหรับการโต้ตอบกับตารางใน Microsoft Fabric จุดสิ้นสุดนี้รองรับการดําเนินการเมตาดาต้าแบบอ่านอย่างเดียวสําหรับตารางเดลต้าใน Fabric การดําเนินการเหล่านี้เข้ากันได้กับ มาตรฐานแบบเปิดของ Unity Catalog API

สําคัญ

คุณลักษณะนี้อยู่ใน แสดงตัวอย่าง

ตัวอย่างคําขอและการตอบกลับ

ตัวอย่างคําขอและการตอบสนองเหล่านี้แสดงให้เห็นถึงการใช้การดําเนินการ Delta API ที่รองรับในปัจจุบันที่ตําแหน่งข้อมูล OneLake table API

สําหรับการดําเนินการแต่ละรายการเหล่านี้:

  • <BaseUrl> คือ https://onelake.table.fabric.microsoft.com/delta
  • <Workspace>/DataItem > สามารถ:
    • <WorkspaceID>/<DataItemID>เช่น 12345678-abcd-4fbd-9e50-3937d8eb1915/98765432-dcba-4209-8ac2-0821c7f8bd91
    • <WorkspaceName>/<DataItemName>.<DataItemType>เช่น MyWorkspace/MyItem.Lakehouseตราบใดที่ทั้งสองชื่อไม่มี
      อักขระ
  • <Token> คือค่าโทเค็นการเข้าถึงที่ส่งคืนโดย Microsoft Entra ID เมื่อการรับรองความถูกต้องสําเร็จ

รายการสคีมา

แสดงรายการ Schema ภายในรายการข้อมูล Fabric

  • ขอร้อง
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"
  • การตอบสนอง
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
}

แสดงรายการตาราง

แสดงรายการตารางภายในสคีมาที่กําหนด

  • ขอร้อง
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"
  • การตอบสนอง
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
}

รับตาราง

รับรายละเอียดตารางสําหรับตารางที่กําหนด

ขอร้อง

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"

การตอบสนอง

    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"
    }