LoginSignup
2
0

Microsoft Fabric Lakehouse で、テーブルが読み込めないケースのうち、DeltaTableIsInfrequentlyCheckpointed が表示される場合の対処策

Posted at

はじめに

日本語検索ひっかかるように記事投稿

以下のようにレイクハウスのテーブルでエラーが出る場合があります。

image.png

image.png

対処

データフロー Gen 2 の既知の不具合で _last_checkpoint が更新されないようです。

以下が有志の対処コード。ワークスペース上のすべてのレイクハウステーブルのチェックポイントを作成します。(DeltaLogはPython API が見つからなかった)

scala

%%spark

import org.apache.spark.sql.delta.DeltaLog

val lakehouses = spark.catalog.listDatabases()

lakehouses.collect().sortWith(_.name < _.name).foreach { lakehouse =>

  if (lakehouse.name != "DataflowsStagingLakehouse") {

    val tables = spark.catalog.listTables(lakehouse.name)

    tables.collect().sortWith(_.name < _.name).foreach { table =>

      DeltaLog.forTable(spark, s"${lakehouse.locationUri}/${table.name}").checkpoint()
      println(s"Completed code run for lakehouse: ${lakehouse.name}, table: ${table.name}")

    }

  }

}


2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0