我正在使用Teradata的Aster,并试图解析一个pdf(或html)文件,以便将其插入到Aster中的Beehive数据库的表中。整个pdf应该对应于表中的单行数据。
这可以通过使用Aster的一个名为documentParser的SQL-MR函数来完成。这将产生一个文本文件(.rtf),其中包含通过解析pdf文件中的所有章节而产生的一行,然后将其加载到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的函数。这是我得到的错误-
ERROR: function "documentparser" does not exist我使用命令\dF多次尝试搜索此函数,但没有找到任何匹配项。
我附上了一张图片,它展示了我正在尝试做的事情的要点。
如果任何人有这方面的经验,我将不胜感激。
发布于 2016-12-22 00:31:53
发生的事情是,有人告诉你这个函数,但是从来没有给你函数存档文件(documentParser.zip)安装在documentParser中。这个功能确实存在,但它不是官方Aster Analytics Foundation (AAF)的一部分。请联系向您提供此信息的人员以获取帮助。
documentParser属于所谓的现场功能,这些功能仅由Aster现场团队开发和使用。并不是说你不能使用它,但不要指望支持会帮助你--只有那些给了你访问它的人。
如果你没有任何联系人,那么下一步我建议你去Aster Community Network上询问一下。
https://stackoverflow.com/questions/40580355
复制相似问题