私は Teradata の Aster を使用しており、pdf(または html) ファイルを解析して、Aster の Beehive データベースのテーブルに挿入しようとしています。pdf 全体がテーブル内の 1 行のデータに対応している必要があります。
これは、 と呼ばれる Aster の SQL-MR 関数の 1 つを使用して実行されますdocumentParser
。これにより、pdf ファイルからすべての章を解析して生成された単一の行を含むテキスト ファイル (.rtf) が生成され、Beehive のテーブルに読み込まれます。
documentParser
この解析プロセスの使用とその他の手順を示すこのスクリプトが提供されています。
/* SHELL INSTRUCTIONS */
--transform file in b64 (change file names to your relevant file)
base64 pp.pdf>pp.b64
--prepare a loadfile
rm my_load_file.txt
-- get the content of the file
var=$(cat pp.b64)
-- put in file
echo \""pp.b64"\"","\""$var"\" >> "my_load_file.txt"
-- create staging table
act -U db_superuser -w db_superuser -d beehive -c "drop table if exists public.cf_load_file;"
act -U db_superuser -w db_superuser -d beehive -c "create dimension table public.cf_load_file(file_name varchar, content varchar);"
-- load into staging table
ncluster_loader -U db_superuser -w db_superuser -d beehive --csv --verbose public.cf_load_file my_load_file.txt
-- use document parser to load the clean text (you will need to create the table beforehand)
act -U db_superuser -w db_superuser -d beehive -c "INSERT INTO got_data.cf_got_text_data (file_name, content) SELECT * FROM documentParser (ON public.cf_load_file documentCol ('content') mode ('text'));"
--done
documentParser
しかし、 Aster で使用できる関数のリストに呼び出される関数がないように見えるため、スクリプトの最後のステップで行き詰まっています。これは私が得るエラーです -
ERROR: function "documentparser" does not exist
コマンドでこの関数を何度か検索しようとしました\dF
が、一致するものはありませんでした。
私がやろうとしていることの要点を示す写真を添付しました。
誰かがこれについて何か経験があれば、私は助けていただければ幸いです。