私はTeradataのAsterで作業しており、pdf(またはhtml)ファイルをAsterのBeehiveデータベースのテーブルに挿入するように解析しようとしています。 pdf全体は、表内の1行のデータに対応する必要があります。Teradata AsterのdocumentParser関数を使用
これは、documentParser
と呼ばれるAsterのSQL-MR機能の1つを使用して行われます。これにより、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
Asterで利用可能な関数のリストにdocumentParser
という関数はありません。私は、コマンド\dF
と、この機能のために、数回の検索を試みたが、いずれの試合を取得していない
ERROR: function "documentparser" does not exist
- これは私が取得エラーです。
私は何をしようとしているかの要点を示す画像を添付しました。
いずれかがこれでどんな経験を持っている場合、私は任意の助けをいただければ幸いです。何が起こった