事件
3月31日 下午11時 - 4月2日 下午11時
規模最大的 Fabric、Power BI 與 SQL 學習盛會。 3 月 31 日至 4 月 2 日。 使用代碼 FABINSIDER 可節省 $400。
立即報名適用於:✅Microsoft Fabric 中的 SQL 分析端點
SQL 分析端點可讓您使用 T-SQL 語言和 TDS 通訊協定,查詢 Lakehouse 中的資料。 每個 Lakehouse 都有一個 SQL 分析端點。 工作區中的 SQL 分析端點數目符合該工作區中佈建的 Lakehouse 和鏡像資料庫數目。
幕後處理負責掃描 Lakehouse 是否有變更,並將 SQL 分析端點保持在最新狀態,以取得工作區中所有提交至 Lakehouse 的變更。 同步處理程序會由 Microsoft Fabric 平台透明管理。 在 Lakehouse 中偵測到變更時,幕後處理會更新中繼資料,而 SQL 分析端點會反映已提交至 Lakehouse 資料表的變更。 在正常運作條件下,Lakehouse 與 SQL 分析端點之間的延隔時間小於一分鐘。 根據本文中挖掘的一些因素,實際時間長度可能會因幾秒到分鐘而有所不同。
SQL 分析端點會管理自動產生的資料表,因此工作區使用者無法進行修改。 使用者可以藉由新增自己的 SQL 結構描述、檢視、程序和其他資料庫物件,來擴充資料庫模型。
針對 Lakehouse 中的每個 Delta 數據表,SQL 分析端點會自動在適當的架構中產生數據表。 如需 SQL 分析端點自動產生的結構描述資料類型,請參閱 Microsoft Fabric 中的資料類型。
在 SQL 分析端點中建立資料表會稍有延遲。 一旦您在 Lake 中建立或更新 Delta Lake 數據表,就會自動建立/重新整理參考 Delta Lake 數據表的 SQL 分析端點數據表。
重新整理資料表所需的時間量與 Delta 資料表的最佳化程度有關。 如需詳細資訊,請檢閱 Delta Lake 資料表最佳化和 V 順序 ,以深入了解重要案例,及有關如何有效率地維護 Delta 資料表以實現最大效能的深入指南。
您可以在 Fabric 入口網站中手動強制重新整理自動中繼資料掃描。 在 SQL 分析端點的頁面上,選取 [總管] 工具列中的 [重新整理] 按鈕,以重新整理結構描述。 移至 [查詢] 您的 SQL 分析端點,然後尋找 [重新整理] 按鈕,如下圖所示。
Lakehouse 中 Delta 資料表的分割區資料行選擇也會影響將變更同步至 SQL 分析端點所需的時間。 分割區資料行的分割區數目和大小對於效能而言很重要:
大量的小型 Parquet 檔案會增加在 Lakehouse 與其關聯 SQL 分析端點之間同步變更所需的時間。 基於一或多個原因,您最終可能會在 Delta 資料表中產生大量的 Parquet 檔案:
使用以下筆記本列印一份報告,其中詳細說明支援 Delta 資料表的分割區的大小和詳細資料。
delta_table_path
中提供 Delta 資料表的 ABSFF 路徑。
COPY PATH
。可以從下列程式碼區塊複製完整的指令碼:
# Purpose: Print out details of partitions, files per partitions, and size per partition in GB.
from notebookutils import mssparkutils
# Define ABFSS path for your delta table. You can get ABFSS path of a delta table by simply right-clicking on table name and selecting COPY PATH from the list of options.
delta_table_path = "abfss://<workspace id>@<onelake>.dfs.fabric.microsoft.com/<lakehouse id>/Tables/<tablename>"
# List all partitions for given delta table
partitions = mssparkutils.fs.ls(delta_table_path)
# Initialize a dictionary to store partition details
partition_details = {}
# Iterate through each partition
for partition in partitions:
if partition.isDir:
partition_name = partition.name
partition_path = partition.path
files = mssparkutils.fs.ls(partition_path)
# Calculate the total size of the partition
total_size = sum(file.size for file in files if not file.isDir)
# Count the number of files
file_count = sum(1 for file in files if not file.isDir)
# Write partition details
partition_details[partition_name] = {
"size_bytes": total_size,
"file_count": file_count
}
# Print the partition details
for partition_name, details in partition_details.items():
print(f"{partition_name}, Size: {details['size_bytes']:.2f} bytes, Number of files: {details['file_count']}")
事件
3月31日 下午11時 - 4月2日 下午11時
規模最大的 Fabric、Power BI 與 SQL 學習盛會。 3 月 31 日至 4 月 2 日。 使用代碼 FABINSIDER 可節省 $400。
立即報名訓練
模組
Work with Delta Lake tables in Microsoft Fabric - Training
Tables in a Microsoft Fabric lakehouse are based on the Delta Lake technology commonly used in Apache Spark. By using the enhanced capabilities of delta tables, you can create advanced analytics solutions.
認證
Microsoft Certified: Fabric Data Engineer Associate - Certifications
כמהנדסת נתונים של Fabric, עליך להיות בעל מומחיות בנושאים שונים עם דפוסי טעינת נתונים, ארכיטקטורות נתונים ותהליכי תזמור.
文件
Better together - the lakehouse and warehouse - Microsoft Fabric
Learn more about scenarios for the lakehouse and data warehousing workloads in Microsoft Fabric.
Source control with Warehouse (preview) - Microsoft Fabric
Learn how to use source control with Microsoft Fabric Warehouse.
Warehouse performance guidelines - Microsoft Fabric
This article contains a list of performance guidelines for warehouse.