Enno Shioji
Enno Shioji

Reputation: 26882

How can select a column and do a TRANSFORM in Hive?

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;

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

Upvotes: 21

Views: 15048

Answers (1)

Enno Shioji
Enno Shioji

Reputation: 26882

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;

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

Upvotes: 25

Related Questions