【问题标题】:how to use hive table as a input in python?如何在 python 中使用 hive 表作为输入?
【发布时间】:2016-11-23 19:48:42
【问题描述】:

我在 Hive 中有 3 张桌子。我想将这 3 个表用作 python 中的输入,并根据某些条件更新一些列值。更新列值后,将它们放入新的配置单元表中。

知道怎么做吗?

【问题讨论】:

  • 这是非常广泛的,不可能按原样回答。请使用示例数据、您的 Hive 和 Python 代码以及您想要的输出来更新问题。您提供的信息越多,得到答案的可能性就越高。

标签: python python-2.7 python-3.x hadoop hive


【解决方案1】:

真巧,我第一次写了一个一小时大的python脚本。

使用转换:https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Transform

add file hive_recursion.py;

select transform(id, category_parent_id, '===') using 'python hive_recursion.py' as ( xxx ) 
from navigation_category limit 111; 

【讨论】:

  • 谢谢。它的固定...非常感谢
猜你喜欢
  • 1970-01-01
  • 2023-01-02
  • 2011-12-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-11
  • 2015-04-10
相关资源
最近更新 更多