Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hive 没有动态分区,无法向配置单元外部表添加/更新空分区_Hive_Hiveql - Fatal编程技术网

Hive 没有动态分区,无法向配置单元外部表添加/更新空分区

Hive 没有动态分区,无法向配置单元外部表添加/更新空分区,hive,hiveql,Hive,Hiveql,我有一个按dt(字符串)分区的配置单元外部表 分区列中的某些值为none,这意味着这些行进入空分区(dt=HIVE\u DEFAULT\u分区)。我想更新这个分区的位置 alter table `zdb.table` partition(dt="__HIVE_DEFAULT_PARTITION__") set location "s3a://path/zdb.db/table/dt=__HIVE_DEFAULT_PARTITION__"; 0:jdbc:

我有一个按dt(字符串)分区的配置单元外部表

分区列中的某些值为none,这意味着这些行进入空分区(dt=HIVE\u DEFAULT\u分区)。我想更新这个分区的位置

alter table `zdb.table` partition(dt="__HIVE_DEFAULT_PARTITION__") set location "s3a://path/zdb.db/table/dt=__HIVE_DEFAULT_PARTITION__";
0:jdbc:hive2://localhost:10000/>alter table`zdb.table`partition(dt=\uu配置单元\默认配置单元\设置位置”s3a://path/zdb.db/table/dt=\uu配置单元\默认配置单元\设置位置”;
错误:编译语句时出错:失败:ParseException行1:71缺少“”附近的\'at')(状态=42000,代码=40000)
0:jdbc:hive2://localhost:10000/>alter table`zdb.table`partition(dt=null)set location“s3a://path/zdb.db/table/dt=\uuu配置单元\默认分区\ uuuuuu”;
错误:编译语句时出错:失败:SemanticException[错误10248]:无法添加void类型的分区列dt,因为它无法转换为string类型(state=42000,code=10248)
0:jdbc:hive2://localhost:10000/>alter table`zdb.table`partition(dt=“\uu配置单元\默认配置单元\分区\设置位置”s3a://path/zdb.db/table/dt=\uuuuu配置单元\默认配置单元\分区\分区”;
错误:org.apache.hive.service.cli.HiveSQLException:处理语句时出错:失败:执行错误,从org.apache.hadoop.hive.ql.exec.ddlstask返回代码1。无法更改分区。无法更改分区,因为表或数据库不存在。
位于org.apache.hive.service.cli.operation.operation.toSQLException(operation.java:380)
位于org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:257)
位于org.apache.hive.service.cli.operation.SQLOperation.access$800(SQLOperation.java:91)
位于org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:348)
位于java.security.AccessController.doPrivileged(本机方法)
位于javax.security.auth.Subject.doAs(Subject.java:422)
位于org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1844)
位于org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:363)
位于java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
在java.util.concurrent.FutureTask.run(FutureTask.java:266)处
位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
位于java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
运行(Thread.java:748)
原因:org.apache.hadoop.hive.ql.metadata.HiveException:无法更改分区。无法更改分区,因为表或数据库不存在。
位于org.apache.hadoop.hive.ql.metadata.hive.alterPartitions(hive.java:743)
位于org.apache.hadoop.hive.ql.exec.ddlstask.alterTable(ddlstask.java:3592)
位于org.apache.hadoop.hive.ql.exec.ddlstask.execute(ddlstask.java:390)
位于org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:199)
位于org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100)
位于org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2183)
位于org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1839)
位于org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1526)
位于org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
位于org.apache.hadoop.hive.ql.Driver.run(Driver.java:1232)
位于org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:255)
... 还有11个
原因:InvalidOperationException(消息:无法更改分区,因为表或数据库不存在。)
位于org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter\u partitions\u with_environment\u context\u result$alter\u partitions\u with_environment\u context\u results standardscheme.read(ThriftHiveMetastore.java)
位于org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter\u partitions\u with_environment\u context\u result$alter\u partitions\u with_environment\u context\u results standardscheme.read(ThriftHiveMetastore.java)
位于org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter\u partitions\u with\u environment\u context\u result.read(ThriftHiveMetastore.java)
位于org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:86)
位于org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_alter_partitions_与_环境_上下文(ThriftHiveMetastore.java:2843)
位于org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.alter_partitions_与_环境_上下文(ThriftHiveMetastore.java:2827)
位于org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_分区(HiveMetaStoreClient.java:1533)
位于sun.reflect.GeneratedMethodAccessor166.invoke(未知源)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中
位于java.lang.reflect.Method.invoke(Method.java:498)
位于org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:173)
位于com.sun.proxy.$Proxy34.alter\u分区(未知源)
位于sun.reflect.GeneratedMethodAccessor166.invoke(未知源)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中
位于java.lang.reflect.Method.invoke(Method.java:498)
位于org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2336)
位于com.sun.proxy.$Proxy34.alter\u分区(未知源)
位于org.apache.hadoop.hive.ql.metadata.hive.alterPartitions(hive.java:739)
... 21个以上(状态=08S01,代码=1)
另外,我注意到,拖放分区正在工作

0: jdbc:hive2://localhost:10000/> alter table `zdb.table` drop partition(dt="__HIVE_DEFAULT_PARTITION__") ;
No rows affected (0.08 seconds)
使用与添加分区相同的语法失败

0:jdbc:hive2://localhost:10000/>alter table`zdb.table`add partition(dt=“\uu-HIVE\u-DEFAULT\u-partition\uuuuu”)location”s3a://path/zdb.db/table/dt=\uu-HIVE\u-DEFAULT\u-partition\uuuuuuu”;
错误:编译语句时出错:失败:SemanticException[Error 10111]:分区值包含保留子字符串(用户值:_配置单元\默认\u分区\保留子字符串:_配置单元_
INSERT INTO zdb.table PARTITION(DT) SELECT * FROM (SELECT <all columns except dt>,CAST(NULL AS STRING) DT )T;