google / google/struct2tensor

Usage with pyarrow parquet

オープン
#10 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
36
フォーク
22
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello, I'm very interested by the library usage however I struggle to apply it to a parquet file other than the dremel example.

````
from struct2tensor import expression_impl
import struct2tensor as s2t
import pyarrow as pa
import pyarrow.parquet as pq

tbl = pa.table([pa.array([0, 1])], names='a')
pq.ParquetWriter('/tmp/test', tbl.schema).write_table(tbl)
filenames = ["/tmp/test"]
batch_size = 2

exp = s2t.expression_impl.parquet.create_expression_from_parquet_file(filenames)
ps = exp.project(['a'])

val = s2t.expression_impl.parquet.calculate_parquet_values([ps], exp,
filenames, batch_size)
for h in val:
break
````

segfaults with the error:
2021-04-15 15:30:40.254237: E struct2tensor/kernels/parquet/parquet_reader.cc:198]
The repetition type of the root node was 0, but should be 2. There may be something wrong with your supplied parquet schema. We will treat it as a repeated field.

2021-04-15 15:31:46.428109: W tensorflow/core/framework/dataset.cc:477]
Input of ParquetDatasetOp::Dataset will not be optimized because the dataset does not implement the AsGraphDefInternal() method needed to apply optimizations.

I also tried saving again the dremel file loaded with Pyarrow and dumping it right away and I can reproduce the error.

How do you advise to save your parquet ?

Thanks for your help !

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Issue にある PyArrow の reproducer から始め、struct2tensor/kernels/parquet/parquet_reader.cc の 198 行目付近を調べ、生成された schema と dremel の例を比較します。例に示されている parquet 式と値計算のエントリポイントをたどります。PyArrow で書き込まれた parquet ファイルを、報告されている schema エラーや segfault なしで読み取れるようになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, tensorflow
領域
data-engineering
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。