Konrad
Konrad

Reputation: 18657

Hive - change column types for all columns without knowing column names

Given table of format:

hive> describe tableA;
OK
id      int
ts      timestamp
var     float
...     ...

I would like to utilise a solution similar to the one discussed by @interskh converting all columns to strings without knowing and explicitly referring to column names.

On the lines of the syntax:

ALTER TABLE tableA CHANGE <<all columnns>> string

Upvotes: 1

Views: 2084

Answers (1)

Andrea
Andrea

Reputation: 4503

As far as I know, you have to change the column's datatype one by one. You can't alter all the column's name or datatype in a single query, according to the official documentation. Please refer to this question I recently answered.

Upvotes: 2

Related Questions