【问题标题】:ToDate() Pig UDF import failingToDate() Pig UDF 导入失败
【发布时间】:2015-01-28 18:34:52
【问题描述】:

我正在尝试将 YYYY-MM-DD 格式的时间转换为日期时间,以便稍后对其进行数学运算。

grunt> describe times_target;
times_target: {new_format: chararray,target: chararray}

grunt> dump times_target;
(2015-01-24,negative)
(2015-01-24,negative)
(2015-01-24,negative)
(2015-01-24,negative)

这是我尝试过的,我得到的错误:

grunt> C = FOREACH times_target GENERATE ToDate(new_format, 'yyyy-MM-dd');
2015-01-28 13:28:00,074 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve ToDate using imports: [, org.apache.pig.builtin., org.apache.pig.impl.builtin.]

我注册了 common.pig.jar 并没有帮助。我究竟做错了什么?我可以将其转换为 ISO,但为什么简单的 ToDate 不起作用?

提前致谢!!

【问题讨论】:

  • 你用的是什么版本的猪?
  • 感谢您的回复,很抱歉我遗漏了那条重要的信息。我从 2012 年中期开始使用 0.10.0。

标签: apache-pig


【解决方案1】:

ToDate 直到 0.11 才添加到 Pig

【讨论】:

  • 是的,你是对的。我错过了那里。更新答案。
猜你喜欢
  • 1970-01-01
  • 2013-12-31
  • 1970-01-01
  • 2013-11-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多