0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Databricks にて Iceberg 参照する際の Byte-buffer read unsupported by com.databricks.common.filesystem.LokiAbfsInputStream への対応方法

Posted at

概要

Databricks Runtime 14.3上で Apache iceberg 形式のデータからデータフレームを作成する際の下記エラーへの対応方法を共有します。下記エラーは Databricks 仕様により発生するため、Databricks Runtime 16.0 以降のクラスターで実行すれば動作するようです。対応方法を共有します。

UnsupportedOperationException: Byte-buffer read unsupported by com.databricks.common.filesystem.LokiAbfsInputStream
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3) (10.139.64.13 executor driver): java.lang.UnsupportedOperationException: Byte-buffer read unsupported by com.databricks.common.filesystem.LokiAbfsInputStream

image.png

対応方法については、 Apache Iceberg の下記の Issue にて言及されておりました。

事前準備

下記記事の事前準備と同様の手順を実施してください。

エラーの再現方法

df = spark.read.format("org.apache.iceberg.spark.source.IcebergSource").load(table_dir)
df.printSchema()
df.display()

image.png

対応方法

1. Databricks Runtime 16.0 以降のクラスターを作成

Databricks Runtime 16.X のクラスターを、アクセスモードを分離なし共有に、 Spark 3.5 の Apache Iceberg 関連のライブラリをインストールに、それぞれ設定して作成します。

image.png

image.png

2. コードが正常に動作することを確認

df = spark.read.format("org.apache.iceberg.spark.source.IcebergSource").load(table_dir)
df.printSchema()
df.display()

image.png

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?