如何在 Hive 中选择一列并进行转换? [英] How can select a column and do a TRANSFORM in Hive?

查看:21
本文介绍了如何在 Hive 中选择一列并进行转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Hive 0.8.1 中使用 TRANSFORM USING,并注意到这是无效的语法:

I was using TRANSFORM USING with Hive 0.8.1, and noticed that this is invalid syntax:

SELECT
    a,
    TRANSFORM(b, c) USING 'fake.py' AS d,
FROM test_table;

删除a"使此语句有效.使用它的正确方法是什么?

Removing "a," makes this statement work. What is the correct way of using this?

推荐答案

显然这是不可能的.fake.py 也必须处理这个问题,即必须做

Apparently this is not possible. The fake.py has to handle that as well, i.e. one must do

SELECT
    TRANSFORM(a, b, c) USING 'fake.py' AS a, d
FROM test_table;

并设置为 fake.py 也输出 'a'.

and make it so that fake.py does output 'a' as well.

这篇关于如何在 Hive 中选择一列并进行转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆