Hive报错:
Error: Error while processing statement: Cannot modify mapreduce.job.name at runtime.
It is not in list of params that are allowed to be modified at runtime (state=42000,code=1)
解决方法:
在hive-site.xml中增加如下配置:
<property>
<name>hive.security.authorization.sqlstd.confwhitelist</name>
<value>mapred.*|hive.*|mapreduce.*|spark.*</value>
</property>
<property>
<name>hive.security.authorization.sqlstd.confwhitelist.append</name>
<value>mapred.*|hive.*|mapreduce.*|spark.*</value>
</property>
报错信息如下:
java.io.IOException: OS command error exit with return code: 1, error message: SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/3.0.1.0-187/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/3.0.1.0-187/hadoop/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://hadoop5.hope:2181,hadoop3.hope:2181,hadoop4.hope:2181/default;password=hope888;serviceDiscoveryMode=zooKeeper;user=hive;zooKeeperNamespace=hiveserver2
20/12/18 11:34:22 [main]: INFO jdbc.HiveConnection: Connected to hadoop4.hope:10000
Connected to: Apache Hive (version 3.1.0.3.0.1.0-187)
Driver: Hive JDBC (version 3.1.0.3.0.1.0-187)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Error: Error while processing statement: Cannot modify mapreduce.job.name at runtime. It is not in list of params that are allowed to be modified at runtime (state=42000,code=1)
Closing: 0: jdbc:hive2://hadoop5.hope:2181,hadoop3.hope:2181,hadoop4.hope:2181/default;password=hope888;serviceDiscoveryMode=zooKeeper;user=hive;zooKeeperNamespace=hiveserver2
The command is:
hive -e "set mapreduce.job.name=Create Intermediate Flat Hive Table kylin_sales_cube 0f5850c5-c4bc-0aef-53bf-cff63393202b-00;
USE default;
DROP TABLE IF EXISTS kylin_intermediate_kylin_sales_cube_edcebe1f_dcd7_b9cd_bc17_b91b77ef6573;
CREATE EXTERNAL TABLE IF NOT EXISTS kylin_intermediate_kylin_sales_cube_edcebe1f_dcd7_b9cd_bc17_b91b77ef6573
(
\`KYLIN_SALES_TRANS_ID\` bigint
,\`KYLIN_SALES_PART_DT\` date
,\`KYLIN_SALES_LEAF_CATEG_ID\` bigint
,\`KYLIN_SALES_LSTG_SITE_ID\` int
,\`KYLIN_CATEGORY_GROUPINGS_META_CATEG_NAME\` string
,\`KYLIN_CATEGORY_GROUPINGS_CATEG_LVL2_NAME\` string
,\`KYLIN_CATEGORY_GROUPINGS_CATEG_LVL3_NAME\` string
,\`KYLIN_SALES_LSTG_FORMAT_NAME\` string
,\`KYLIN_SALES_SELLER_ID\` bigint
,\`KYLIN_SALES_BUYER_ID\` bigint
,\`BUYER_ACCOUNT_ACCOUNT_BUYER_LEVEL\` int
,\`SELLER_ACCOUNT_ACCOUNT_SELLER_LEVEL\` int
,\`BUYER_ACCOUNT_ACCOUNT_COUNTRY\` string
,\`SELLER_ACCOUNT_ACCOUNT_COUNTRY\` string
,\`BUYER_COUNTRY_NAME\` string
,\`SELLER_COUNTRY_NAME\` string
,\`KYLIN_SALES_OPS_USER_ID\` string
,\`KYLIN_SALES_OPS_REGION\` string
,\`KYLIN_SALES_PRICE\` decimal(19,4)
)
STORED AS SEQUENCEFILE
LOCATION 'hdfs://hadoop5.hope:8020/kylin/kylin_metadata/kylin-0f5850c5-c4bc-0aef-53bf-cff63393202b/kylin_intermediate_kylin_sales_cube_edcebe1f_dcd7_b9cd_bc17_b91b77ef6573';
ALTER TABLE kylin_intermediate_kylin_sales_cube_edcebe1f_dcd7_b9cd_bc17_b91b77ef6573 SET TBLPROPERTIES('auto.purge'='true');
INSERT OVERWRITE TABLE \`kylin_intermediate_kylin_sales_cube_edcebe1f_dcd7_b9cd_bc17_b91b77ef6573\` SELECT
\`KYLIN_SALES\`.\`TRANS_ID\` as \`KYLIN_SALES_TRANS_ID\`
,\`KYLIN_SALES\`.\`PART_DT\` as \`KYLIN_SALES_PART_DT\`
,\`KYLIN_SALES\`.\`LEAF_CATEG_ID\` as \`KYLIN_SALES_LEAF_CATEG_ID\`
,\`KYLIN_SALES\`.\`LSTG_SITE_ID\` as \`KYLIN_SALES_LSTG_SITE_ID\`
,\`KYLIN_CATEGORY_GROUPINGS\`.\`META_CATEG_NAME\` as \`KYLIN_CATEGORY_GROUPINGS_META_CATEG_NAME\`
,\`KYLIN_CATEGORY_GROUPINGS\`.\`CATEG_LVL2_NAME\` as \`KYLIN_CATEGORY_GROUPINGS_CATEG_LVL2_NAME\`
,\`KYLIN_CATEGORY_GROUPINGS\`.\`CATEG_LVL3_NAME\` as \`KYLIN_CATEGORY_GROUPINGS_CATEG_LVL3_NAME\`
,\`KYLIN_SALES\`.\`LSTG_FORMAT_NAME\` as \`KYLIN_SALES_LSTG_FORMAT_NAME\`
,\`KYLIN_SALES\`.\`SELLER_ID\` as \`KYLIN_SALES_SELLER_ID\`
,\`KYLIN_SALES\`.\`BUYER_ID\` as \`KYLIN_SALES_BUYER_ID\`
,\`BUYER_ACCOUNT\`.\`ACCOUNT_BUYER_LEVEL\` as \`BUYER_ACCOUNT_ACCOUNT_BUYER_LEVEL\`
,\`SELLER_ACCOUNT\`.\`ACCOUNT_SELLER_LEVEL\` as \`SELLER_ACCOUNT_ACCOUNT_SELLER_LEVEL\`
,\`BUYER_ACCOUNT\`.\`ACCOUNT_COUNTRY\` as \`BUYER_ACCOUNT_ACCOUNT_COUNTRY\`
,\`SELLER_ACCOUNT\`.\`ACCOUNT_COUNTRY\` as \`SELLER_ACCOUNT_ACCOUNT_COUNTRY\`
,\`BUYER_COUNTRY\`.\`NAME\` as \`BUYER_COUNTRY_NAME\`
,\`SELLER_COUNTRY\`.\`NAME\` as \`SELLER_COUNTRY_NAME\`
,\`KYLIN_SALES\`.\`OPS_USER_ID\` as \`KYLIN_SALES_OPS_USER_ID\`
,\`KYLIN_SALES\`.\`OPS_REGION\` as \`KYLIN_SALES_OPS_REGION\`
,\`KYLIN_SALES\`.\`PRICE\` as \`KYLIN_SALES_PRICE\`
FROM \`DEFAULT\`.\`KYLIN_SALES\` as \`KYLIN_SALES\`
INNER JOIN \`DEFAULT\`.\`KYLIN_CAL_DT\` as \`KYLIN_CAL_DT\`
ON \`KYLIN_SALES\`.\`PART_DT\` = \`KYLIN_CAL_DT\`.\`CAL_DT\`
INNER JOIN \`DEFAULT\`.\`KYLIN_CATEGORY_GROUPINGS\` as \`KYLIN_CATEGORY_GROUPINGS\`
ON \`KYLIN_SALES\`.\`LEAF_CATEG_ID\` = \`KYLIN_CATEGORY_GROUPINGS\`.\`LEAF_CATEG_ID\` AND \`KYLIN_SALES\`.\`LSTG_SITE_ID\` = \`KYLIN_CATEGORY_GROUPINGS\`.\`SITE_ID\`
INNER JOIN \`DEFAULT\`.\`KYLIN_ACCOUNT\` as \`BUYER_ACCOUNT\`
ON \`KYLIN_SALES\`.\`BUYER_ID\` = \`BUYER_ACCOUNT\`.\`ACCOUNT_ID\`
INNER JOIN \`DEFAULT\`.\`KYLIN_ACCOUNT\` as \`SELLER_ACCOUNT\`
ON \`KYLIN_SALES\`.\`SELLER_ID\` = \`SELLER_ACCOUNT\`.\`ACCOUNT_ID\`
INNER JOIN \`DEFAULT\`.\`KYLIN_COUNTRY\` as \`BUYER_COUNTRY\`
ON \`BUYER_ACCOUNT\`.\`ACCOUNT_COUNTRY\` = \`BUYER_COUNTRY\`.\`COUNTRY\`
INNER JOIN \`DEFAULT\`.\`KYLIN_COUNTRY\` as \`SELLER_COUNTRY\`
ON \`SELLER_ACCOUNT\`.\`ACCOUNT_COUNTRY\` = \`SELLER_COUNTRY\`.\`COUNTRY\`
WHERE 1=1 AND (\`KYLIN_SALES\`.\`PART_DT\` >= '2012-01-01' AND \`KYLIN_SALES\`.\`PART_DT\` < '2020-12-04')
;
" --hiveconf hive.merge.mapredfiles=false --hiveconf hive.auto.convert.join=true --hiveconf hive.exec.compress.output=true --hiveconf hive.auto.convert.join.noconditionaltask=true --hiveconf hive.merge.mapfiles=false --hiveconf hive.auto.convert.join.noconditionaltask.size=100000000 --hiveconf hive.stats.autogather=true
at org.apache.kylin.common.util.CliCommandExecutor.execute(CliCommandExecutor.java:96)
at org.apache.kylin.source.hive.CreateFlatHiveTableStep.createFlatHiveTable(CreateFlatHiveTableStep.java:59)
at org.apache.kylin.source.hive.CreateFlatHiveTableStep.doWork(CreateFlatHiveTableStep.java:97)
at org.apache.kylin.job.execution.AbstractExecutable.execute(AbstractExecutable.java:179)
at org.apache.kylin.job.execution.DefaultChainedExecutable.doWork(DefaultChainedExecutable.java:71)
at org.apache.kylin.job.execution.AbstractExecutable.execute(AbstractExecutable.java:179)
at org.apache.kylin.job.impl.threadpool.DefaultScheduler$JobRunner.run(DefaultScheduler.java:114)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)