2
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?

More than 5 years have passed since last update.

Python, R で作成したApache Arrow ファイル を Typescript で読み込み

2
Posted at

この記事の目的。

ふとした疑問。Python or R にて feather format で保存したファイルを Typescript から読み込みは問題なくできるのだろうか。(面倒なのでRからは省略)

Prerequisite

一連のファイルを github repository にあげた。なお、自分は Typescript の予備知識がほぼゼロなので、 Dockerfile に書いた npm のコマンドは適当なので、改善提案を頂けるとありがたいです。

考察および得た知識

  • 結論: できる。 Apache Arrow は .feather, .arrow と異なる拡張子が与えられることがあり、実体としてのフォーマットが一体何なのかよくわかっていなかったが、実は同じことが確認できた。
  • ただし、 Javascript (Typescript) での feather format の読み込みは、 python 側での作成で compression='uncompressed' を指定したファイルでないと読み込めない。
  • JS example で table.toString() によりテーブル内容表示されるとあるが、自分の実行環境では [object Object] しか表示されず悲しみ。自分で markdown 表示の関数作って何とかしのぐ必要があった。
  • JS側の Table object が Iterable ではなかったので、そのまま map できずに不便。ここは型宣言を見たがよくわからず。

今後の課題

  • Typescript側での Date32 型が一体何なのか不明のまま。

References:

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?