---
title: DeltaLake.Table – อ่านตารางจาก Delta Lake
url: https://www.thepexcel.com/functions/power-query/accessing-data-functions/deltalake-table/
type: function-explainer
program: Power Query
syntax: "DeltaLake.Table(directory as table, [options as nullable record]) as any"
date: 2025-12-12
updated: 2025-12-26
scores:
  popularity: 4
  difficulty: 5
  usefulness: 5
---

# DeltaLake.Table – อ่านตารางจาก Delta Lake

> DeltaLake.Table ใช้ดึงข้อมูลจากตาราง Delta Lake โดยระบุที่อยู่ไดเรกทอรี่ของตาราง เหมาะสำหรับเชื่อมต่

## คำอธิบาย

DeltaLake.Table ใช้ดึงข้อมูลจากตาราง Delta Lake โดยระบุที่อยู่ไดเรกทอรี่ของตาราง เหมาะสำหรับเชื่อมต่อกับ Data Lake หรือ Microsoft Fabric

## Syntax

```excel
DeltaLake.Table(directory as table, [options as nullable record]) as any
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| directory | Yes | table |  | ตัวแปรตาราง Delta Lake หรือเส้นทางไดเรกทอรี่ของตารางที่ต้องการอ่าน |
| options | No | record | null | บันทึกตัวเลือกสำหรับปรับแต่งการอ่านตาราง เช่น การตั้งค่าการเชื่อมต่อหรือพารามิเตอร์การประมวลผลข้อมูล |

## ตัวอย่าง

### 1. อ่านตารางพื้นฐาน

```excel
let
    DeltaPath = "abfss://container@storage.dfs.core.windows.net/delta-table",
    DeltaTable = DeltaLake.Table(DeltaPath)
in
    DeltaTable
```

**ผลลัพธ์:** `ตารางที่มีคอลัมน์และแถวจากตาราง Delta Lake`

ผมระบุเส้นทาง ABFS ของตาราง Delta Lake และใช้ DeltaLake.Table เพื่ออ่านข้อมูลทั้งหมดจากตาราง ผลลัพธ์จะเป็นตารางที่พร้อมสำหรับการประมวลผลต่อไป

### 2. อ่านตารางพร้อมตัวเลือก

```excel
let
    DeltaPath = "abfss://container@storage.dfs.core.windows.net/delta-table",
    Options = [IncludeVersion = true],
    DeltaTable = DeltaLake.Table(DeltaPath, Options)
in
    DeltaTable
```

**ผลลัพธ์:** `ตารางที่มีข้อมูลเวอร์ชัน Delta Lake`

ผมเพิ่มพารามิเตอร์ options เพื่อให้รวมข้อมูลเวอร์ชันของตาราง Delta ซึ่งช่วยให้ผมสามารถติดตามการเปลี่ยนแปลงของข้อมูลเมื่อเวลาผ่านไป

### 3. ใช้กับ Fabric Data Lake

```excel
let
    Source = Fabric.DataLakeFolder("lakehouse-name"),
    DeltaTable = DeltaLake.Table(Source/"tables"/"my-table")
in
    DeltaTable
```

**ผลลัพธ์:** `ตารางจาก Microsoft Fabric Lakehouse`

ผมใช้ Fabric.DataLakeFolder เพื่อเชื่อมต่อกับ Lakehouse ของ Fabric จากนั้นส่งผ่านเส้นทางตารางไปยัง DeltaLake.Table เพื่ออ่านข้อมูล ซึ่งเป็นวิธีที่นิยมใช้กับ Microsoft Fabric

### 4. อ่านหลายตาราง Delta

```excel
let
    BasePath = "abfss://container@storage.dfs.core.windows.net/",
    Table1 = DeltaLake.Table(BasePath & "delta-table-1"),
    Table2 = DeltaLake.Table(BasePath & "delta-table-2"),
    Merged = Table.Combine({Table1, Table2})
in
    Merged
```

**ผลลัพธ์:** `ตารางที่รวมข้อมูลจากสองตารางเข้าด้วยกัน`

ผมอ่านสองตารางแยกกัน แล้วใช้ Table.Combine เพื่อรวมแถวจากทั้งสองตาราง วิธีนี้มีประโยชน์เมื่อต้องการประมวลผลหลายตารางในเวลาเดียวกัน

## หมายเหตุเพิ่มเติม

- ผมแนะนำให้ทดสอบเส้นทาง (path) ของตาราง Delta ให้ถูกต้องก่อนใช้ DeltaLake.Table เพราะข้อผิดพลาดเล็กน้อยอาจทำให้ไม่สามารถอ่านข้อมูลได้

- ส่วนตัวผม ชอบใช้ Fabric.DataLakeFolder เมื่อทำงานกับ Microsoft Fabric เพราะมันจัดการ credential โดยอัตโนมัติ

- ผมขอแนะนำให้ดูตัวเลือก (options) ที่มีให้เลือก เพราะอาจมีการตั้งค่าที่มีประโยชน์สำหรับกรณีใช้งานเฉพาะของคุณ

## คำถามที่พบบ่อย

**Q: DeltaLake.Table ต่างจาก Table.FromRecords อย่างไร?**

ผมคิดว่า DeltaLake.Table ออกแบบมาโดยเฉพาะสำหรับอ่านข้อมูลจากตาราง Delta Lake ซึ่งเป็นรูปแบบพื้นที่เก็บข้อมูลที่มีความสามารถในการติดตามเวอร์ชัน ในขณะที่ Table.FromRecords ใช้สำหรับสร้างตารางจากเรคอร์ด ดังนั้น DeltaLake.Table จึงเหมาะสำหรับ Data Lake มากกว่า

**Q: ใช้ DeltaLake.Table กับ Azure Synapse ได้ไหม?**

ได้ครับ ผมใช้ได้กับ Azure Synapse Analytics เพราะมันสนับสนุน Delta Lake format นอกจากนี้ยังใช้ได้กับ Microsoft Fabric ซึ่งเป็นแพลตฟอร์มที่ใหม่กว่า

**Q: ต้องมี credential อะไรบ้างสำหรับใช้ฟังก์ชันนี้?**

ผมต้องมี credential ที่สามารถเข้าถึง Azure Data Lake Storage (ADLS) ได้ ซึ่งสามารถเป็น Storage Account Key, Managed Identity, หรือ Service Principal ขึ้นอยู่กับการตั้งค่า Access Control ของ Storage Account

## แหล่งข้อมูลเพิ่มเติม

- [Microsoft Learn - DeltaLake.Table](https://learn.microsoft.com/en-us/powerquery-m/deltalake-table) _(official)_
- [Microsoft Fabric Documentation](https://learn.microsoft.com/en-us/fabric/) _(official)_

---

_Source: [https://www.thepexcel.com/functions/power-query/accessing-data-functions/deltalake-table/](https://www.thepexcel.com/functions/power-query/accessing-data-functions/deltalake-table/)_
