【问题标题】:Using documentParser function in Teradata Aster在 Teradata Aster 中使用 documentParser 函数
【发布时间】:2017-03-27 14:16:58
【问题描述】:

我正在使用 Teradata 的 Aster 并尝试解析 pdf(或 html)文件,以便将其插入到 Aster 的 Beehive 数据库中的表中。整个pdf应该对应表格中的一行数据。

这将通过使用名为documentParser 的 Aster 的 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 搜索此函数,但没有找到任何匹配项。

我附上了一张图片,展示了我正在尝试做的事情的要点。

SQL-MR Document Parser

如果有人对此有任何经验,我将不胜感激。

【问题讨论】:

    标签: sql teradata teradata-aster sql-mr


    【解决方案1】:

    发生的事情是有人告诉你这个函数documentParser,但从来没有给你函数存档文件 (documentParser.zip) 来安装在 Aster 中。此功能确实存在,但它不是官方 Aster Analytics Foundation (AAF) 的一部分。请联系向您提供此信息的人寻求帮助。

    documentParser 属于所谓的现场功能,仅由 Aster 现场团队开发和使用。并不是说您不能使用它,但不要指望支持会帮助您 - 只有允许您访问它的人。

    如果您没有任何联系人,那么下一步我建议您前往Aster Community Network 并在那里提问。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-18
      • 2014-08-21
      • 1970-01-01
      • 2017-08-12
      • 1970-01-01
      • 2017-04-30
      • 2018-11-15
      • 2016-10-01
      相关资源
      最近更新 更多