stored as inputformat
时间: 2023-04-24 07:06:53 浏览: 318
"stored as inputformat"的意思是指数据在存储时采用的输入格式。这个输入格式可以是文本格式、序列化格式或其他格式。在Hadoop中,输入格式是指将数据从存储介质中读取出来并转换成MapReduce程序可以处理的键值对格式的过程。因此,"stored as inputformat"是指数据在存储时采用的输入格式,以便MapReduce程序可以正确地读取和处理数据。
相关问题
有一个dws.dws_ty_charge_vehicle_class表,它的建表语句是CREATE TABLE dws.dws_ty_charge_vehicle_class( ty_id string COMMENT '统计表主键', map_id string COMMENT '地图ID', ty_date string COMMENT '统计时间(日)' PARTITIONED BY ( dt_class string, mapid string) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat',表2的建表语句为CREATE TABLE tmp.public_day( ty_id string COMMENT '统计表主键', map_id string COMMENT '地图ID', ty_date string COMMENT '统计时间(日)' ) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'hive 。动态插入分区时 insert overwrite table dws.dws_ty_charge_vehicle_class partition(dt_class,mapid) select ty_id, ty_date, map_id from tmp.fromtpart 会报一个ValidationFailureSemanticException Partition spec {map_id=null, dt_class=null} contains non-partition columns的错误
这个错误是因为你在插入数据时没有指定分区列的值。你需要在INSERT语句中指定分区列的值,例如:
```
INSERT OVERWRITE TABLE dws.dws_ty_charge_vehicle_class PARTITION(dt_class='2022-01-01', mapid='1') SELECT ty_id, ty_date, map_id FROM tmp.public_day;
```
其中,`dt_class`和`mapid`是分区列,需要指定具体的值。在你的错误信息中,`{map_id=null, dt_class=null}`说明你没有指定分区列的值,导致出现了错误。
CREATE TABLE sng_qq_data.qq_adtributor_dimention_rank_info ( `ftime` int comment '日期' , `indicator` string comment '指标' , `rank` int comment '维度排序' , `dimention_type` string comment '维度' , `dimention_value` string comment '维值' , `dimention` string comment '维度_维值' , `pred` double comment '预测值' , `act` double comment '实际值' , `delta` double comment 'diff比例' , `js` double comment '惊奇度' , `explanatorypct` double comment '解释度' , `same_direcition` string comment '是否同向' ) PARTITIONED BY (ftime list) WITH SERDEPROPERTIES ('field.delim' = '|', 'serialization.format' = 'org.apache.hadoop.hive.ql.io.orc.OrcSerde') STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat' LOCATION 'hdfs://ss-tq-icy-c2-v3/user/tdw/warehouse/sng_qq_data.db/qq_adtributor_dimention_rank_info'
这是一个创建名为 `qq_adtributor_dimention_rank_info` 的 Hive 表的 SQL 语句。该表具有以下列:
- `ftime`:表示日期的整数类型列。
- `indicator`:表示指标的字符串类型列。
- `rank`:表示维度排序的整数类型列。
- `dimention_type`:表示维度类型的字符串类型列。
- `dimention_value`:表示维值的字符串类型列。
- `dimention`:表示维度_维值的字符串类型列。
- `pred`:表示预测值的双精度浮点数类型列。
- `act`:表示实际值的双精度浮点数类型列。
- `delta`:表示 diff 比例的双精度浮点数类型列。
- `js`:表示惊奇度的双精度浮点数类型列。
- `explanatorypct`:表示解释度的双精度浮点数类型列。
- `same_direction`:表示是否同向的字符串类型列。
此外,表使用了分区,分区键为 `ftime` 列,并使用 Orc 格式进行存储。表所在的位置为 `hdfs://ss-tq-icy-c2-v3/user/tdw/warehouse/sng_qq_data.db/qq_adtributor_dimention_rank_info`。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)