AzureStorage.DataLake ดึงข้อมูลจากเสถียร Azure Data Lake Storage (ADLS) โดยส่งคืนตารางนำทางของไฟล์ในระบบไฟล์
= AzureStorage.DataLake(endpoint as text, optional options as nullable record) as table
= AzureStorage.DataLake(endpoint as text, optional options as nullable record) as table
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
| endpoint | text | Yes | URL ของบัญชี Azure Data Lake Storage filesystem ในรูปแบบ https://youraccount.dfs.core.windows.net/container | |
| options | record | Optional | null | Record ที่ควบคุมพฤติกรรมการอ่าน/คำขอ (BlockSize, RequestSize, ConcurrentRequests, HierarchicalNavigation) |
AzureStorage.DataLake("https://myaccount.dfs.core.windows.net/mycontainer")= AzureStorage.DataLake("https://myaccount.dfs.core.windows.net/mycontainer")
ตารางนำทางแสดงไฟล์ทั้งหมดในคอนเทนเนอร์ (flat list)
AzureStorage.DataLake( "https://myaccount.dfs.core.windows.net/mycontainer", [BlockSize = 8388608] )= AzureStorage.DataLake(
"https://myaccount.dfs.core.windows.net/mycontainer",
[BlockSize = 8388608]
)
ตารางนำทางสำหรับไฟล์ขนาดใหญ่ด้วยบล็อก 8 MB
AzureStorage.DataLake( "https://myaccount.dfs.core.windows.net/mycontainer", [HierarchicalNavigation = true] )= AzureStorage.DataLake(
"https://myaccount.dfs.core.windows.net/mycontainer",
[HierarchicalNavigation = true]
)
ตารางนำทางแสดงไฟล์เป็นต้นไม้โครงสร้าง (tree view)
let Source = AzureStorage.DataLake( "https://myaccount.dfs.core.windows.net/mycontainer", [ConcurrentRequests = 32, RequestSize = 4194304] ) in Sourcelet
Source = AzureStorage.DataLake(
"https://myaccount.dfs.core.windows.net/mycontainer",
[ConcurrentRequests = 32, RequestSize = 4194304]
)
in
Source
ตารางสำหรับการดาวน์โหลดหลายไฟล์ขนานกัน (parallel)
ใช้ฟังก์ชัน AzureStorage.DataLake ในขั้นตอน ‘เข้าถึงข้อมูล’ (Get Data) ของ Power Query Editor
BlockSize = จำนวนไบต์ที่อ่านก่อนรอผู้ใช้ (default 4MB) | RequestSize = จำนวนไบต์ต่อคำขอ HTTP (default 4MB)
Default 16 ใช้ได้ดี แต่ถ้าไฟล์เล็ก ๆ อย่าง concurrent ต้องเฝ้าหน่วยความจำ (Memory = ConcurrentRequests × RequestSize)
ตั้ง true ถ้าโครงสร้างโฟลเดอร์สำคัญและต้องการเห็นต้นไม้ / false ถ้าต้องการแค่รายการไฟล์แบน
https://{StorageAccountName}.dfs.core.windows.net/{FilesystemName} (เช่น https://myaccount.dfs.core.windows.net/container)
ฟังก์ชัน AzureStorage.DataLake ใช้สำหรับเชื่อมต่อกับระบบจัดเก็บข้อมูล Azure Data Lake Storage (ADLS) และดึงรายการไฟล์พร้อมข้อมูลเมตาดาต้าทั้งหมด ฟังก์ชันนี้จะสร้างตารางนำทาง (navigational table) ที่แสดงโครงสร้างไฟล์และโฟลเดอร์
ที่น่าสนใจคือคุณสามารถควบคุมประสิทธิภาพการอ่านข้อมูลผ่านตัวเลือกต่างๆ เช่น BlockSize สำหรับกำหนดขนาดบล็อกข้อมูล, RequestSize สำหรับกำหนดขนาดคำขอ และ ConcurrentRequests สำหรับกำหนดจำนวนคำขอพร้อมกัน
ส่วนตัวผมชอบใช้ตัวเลือก HierarchicalNavigation เป็นพิเศษ เพราะเมื่อตั้งค่าเป็น true ข้อมูลจะแสดงในรูปแบบต้นไม้ (tree structure) แทนที่จะเป็นรายการแบน ทำให้สามารถจัดการโครงสร้างโฟลเดอร์ได้ง่ายและชัดเจนยิ่งขึ้น โดยเฉพาะเมื่อทำงานกับข้อมูลที่มีหลายระดับโฟลเดอร์