简体   繁体   English

失败:将数据插入到Hive分区表中时,SemanticException org.apache.hadoop.hive.ql.metadata.HiveException

[英]FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException while inserting data into Hive partitioned table

I have an employee data with 3 departments A,B,C . 我有3个部门A,B,C的员工数据。 I am trying to create partioned table on departments . 我正在尝试在部门上创建分区表。 I created the table using below command. 我使用以下命令创建了表。

create external table Parti_Trail (EmployeeID Int,FirstName String,Designation String,Salary Int) PARTITIONED BY (Department String) row format delimited fields terminated by "," location '/user/sree/HiveTrail'; 创建外部表Parti_Trail(EmployeeID Int,FirstName String,Designation String,Salary Int)PARTITIONED BY(部门字符串)行格式,以“,”位置“ / user / sree / HiveTrail”终止;

But this did nt load my table with data in location '/user/sree/HiveTrail' 但这并没有在表'/ user / sree / HiveTrail'中加载数据到我的表

So I tried to load my table 所以我试图加载我的桌子

LOAD DATA INPATH '/user/aibladmin/HiveTrail' OVERWRITE INTO TABLE Parti_SCDTrail PARTITION(department); 

But showing 但是显示

FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: department not found in table's partition spec: {department=null}
  1. Why is it so. 为什么会这样呢。 Am I doing anything wrong? 我做错什么了吗?
  2. What happens if we SET hive.exec.dynamic.partition.mode = nonstrict; 如果我们SET hive.exec.dynamic.partition.mode = nonstrict;会发生什么?
  3. While creating partitioned table , do we need to keep data seperated in different folder or whether it automatically get seperated into different partitions 在创建分区表时,我们是否需要将数据分隔在不同的文件夹中,或者是否将其自动分隔到不同的分区中

For external tables with partition in Hive you need to run an ALTER statement to update the Metastore for new partitions. 对于Hive中具有分区的外部表,您需要运行ALTER语句以更新Metastore中的新分区。 Because external tables are not managed by Hive. 因为外部表不是由Hive管理。

Check this link 检查此链接

Hope it helps...!!! 希望能帮助到你...!!!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 失败:SemanticException org.apache.hadoop.hive.ql.metadata.HiveException - FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException 尝试从表中选择时,Hive显示org.apache.hadoop.hive.ql.metadata.HiveException - Hive showing org.apache.hadoop.hive.ql.metadata.HiveException when trying to select from table 配置单元查询错误java.lang.RuntimeException:org.apache.hadoop.hive.ql.metadata.HiveException - Hive query error java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException 错误:java.lang.RuntimeException:org.apache.hadoop.hive.ql.metadata.HiveException:Hive运行时在处理可写时发生错误 - Error: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing writable org.apache.hadoop.hive.ql.metadata.HiveException:处理行{“ xmldata”:“时,Hive运行时错误 <?xml version=\\”1.0\\“ encoding=\\”UTF-8\\“?> ”} - org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row {“xmldata”:“<?xml version=\”1.0\“ encoding=\”UTF-8\“?>”} When Spark call Hive from oozie, exception raised “java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.metadata.HiveException” - When Spark call Hive from oozie, exception raised “java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.metadata.HiveException” 运行HIVE命令引发错误:线程“ main”中的异常java.lang.RuntimeException:org.apache.hadoop.hive.ql.metadata.HiveException - Running HIVE command throwing error: Exception in thread “main” java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException 使用简单查询时,如何修复 Hive-Spark 中的“org.apache.hadoop.hive.ql.metadata.HiveException”? - How to fix 'org.apache.hadoop.hive.ql.metadata.HiveException' in Hive-Spark, when using simple query? 运行 hive 时出错:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException hive 错误等等 - getting error whle running hive : org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException hive error and many more java.lang.RuntimeException:org.apache.hadoop.hive.ql.metadata.HiveException:org.apache.hadoop.ipc.RemoteException:java.io.IOException: - java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.ipc.RemoteException: java.io.IOException:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM