根据查询创建表:
sql
create table yii_stock_fetch as select code, max(date_int) as last_date
from yii_stock_day_part
where year = 2018 group by code;
自行创建表,直接把查询导入:
sql
create table yii_stock_fetch (
code string,
last_date int
)
STORED AS PARQUET;
insert overwrite table yii_stock_fetch
select code, max(date_int) as last_date
from yii_stock_day_part
where year = 2018 group by code;
Presto 把查询结果导入到 MySQL:
sql
create table mysql.yii_stock.yiidata_stock_fetch as
select code,last_date
from hive.default.yii_stock_fetch;
insert into mysql.yii_stock.yiidata_stock_fetch
select cast(code as varchar(20)) as code,last_date
from hive.default.yii_stock_fetch;
CREATE TABLE user_info( id STRING, name STRING, gender STRING, age int ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE;
set hive.execution.engine=tez; SET mapreduce.job.queuename=hive;
select count() as c from user_info; create table user_info_gender_aggr as select gender, count() as c from user_info group by gender;
load data local inpath '/opt/datasophon/hive/user.txt' into table user_info;
Job Submission failed with exception 'org.apache.hadoop.io.nativeio.NativeIOException(No such file or directory)' ENOENT: No such file or directory submitted by user hive application rejected by placement rules