最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

sql - Create table using substring in hive - Stack Overflow

programmeradmin3浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 1

It 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;
发布评论

评论列表(0)

  1. 暂无评论