I'm trying to create a new table using the substring function in hive. Is this the correct way?:
create table substring_income_dataset
select year, substring(income_total, 1, 2), benefit_type,
from income_dataset;
I'm trying to create a new table using the substring function in hive. Is this the correct way?:
create table substring_income_dataset
select year, substring(income_total, 1, 2), benefit_type,
from income_dataset;
Share
Improve this question
asked Mar 16 at 20:10
Dave DigglerDave Diggler
315 bronze badges
1 Answer
Reset to default 1It looks like you are trying to get data from table income_dataset
into your new table substring_income_dataset
, so do the following instead:
CREATE TABLE substring_income_dataset
AS
SELECT year, substring(income_total, 1, 2), benefit_type
FROM income_dataset;