91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

hive建表中文亂碼如何解決

小億
277
2024-05-29 09:54:22
欄目: 大數據

在Hive中遇到中文亂碼的問題,可能是因為Hive默認使用的編碼方式不是UTF-8,導致無法正確存儲和顯示中文字符。解決方法如下:

  1. 在創建表時指定字符集為UTF-8:
CREATE TABLE table_name (
    column1 STRING,
    column2 INT
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
TBLPROPERTIES ("charset"="utf8");
  1. 在Hive配置文件hive-site.xml中設置默認字符集為UTF-8:
<property>
  <name>hive.default.charset</name>
  <value>utf8</value>
</property>
  1. 修改Hive會話的字符集:
SET hive.cli.print.header=true;
SET hive.cli.print.current.db=true;
SET hive.cli.print.header=true;
SET hive.cli.print.current.db=true;
SET hive.resultset.use.unique.column.names=false;
SET mapred.reduce.tasks=1;
SET hive.metastore.warehouse.dir=/user/hive/warehouse;
SET hive.support.concurrency=false;
SET hive.enforce.bucketing=true;
SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.exec.dynamic.partition=true;
SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.execution.engine=tez;
SET hive.execution.engine=mr;
SET hive.exec.parallel=true;
SET hive.exec.compress.output=true;
SET hive.exec.compress.intermediate=true;
SET hive.exec.reducers.bytes.per.reducer=128000000;
SET hive.exec.reducers.max=1099;
SET hive.exec.reducers.min=1;
SET mapred.reduce.tasks=8;
SET mapred.map.tasks=8;
SET mapred.max.split.size=268435456;
SET hive.exec.max.dynamic.partitions=100000;
SET hive.exec.max.dynamic.partitions.pernode=100000;
SET hive.exec.max.created.files=100000;
SET mapreduce.job.queuename=default;
SET hive.exec.submitviachild=true;
SET hive.downloaded.resources.dir=/tmp/$USER/hive_resources;
SET hive.scratch.dir=/tmp/$USER/hive_scratch;
SET hive.server2.enable.impersonation=true;
SET hive.mapred.local.mode=true;
SET hive.auto.convert.join=true;
SET hive.mapjoin.smalltable.filesize=25000000;
SET hive.auto.convert.join.noconditionaltask=true;
SET hive.compute.query.using.stats=true;
SET hive.stats.fetch.column.stats=true;
SET hive.stats.fetch.partition.stats=true;
SET hive.security.authorization.sqlstd.confwhitelist.append=false;
SET hive.strict.checks.large.query=true;
SET hive.stats.autogather=true;
SET hive.stats.autogather=true;
SET hive.compute.query.using.stats=true;
SET hive.stats.fetch.column.stats=true;
SET hive.stats.fetch.partition.stats=true;
SET hive.security.authorization.sqlstd.confwhitelist.append=false;
SET hive.strict.checks.large.query=true;
SET hive.exec.reducers.max=1099;
SET hive.security.authorization.enabled=false;
SET hive.cli.print.header=true;
SET hive.cli.print.current.db=true;
SET hive.mapred.reduce.tasks=1;
SET hive.metastore.warehouse.dir=/user/hive/warehouse;
SET hive.support.concurrency=false;
SET hive.enforce.bucketing=true;
SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.exec.dynamic.partition=true;
SET hive.exec.dynamic.partition.mode=nonstrict;
SET hive.execution.engine=tez;
SET hive.execution.engine=mr;
SET hive.exec.parallel=true;
SET hive.exec.compress.output=true;
SET hive.exec.compress.intermediate=true;
SET hive.exec.reducers.bytes.per.reducer=128000000;
SET hive.exec.reducers.max=1099;
SET hive.exec.reducers.min=1;
SET mapred.reduce.tasks=8;
SET mapred.map.tasks=8;
SET mapred.max.split.size=268435456;
SET hive.exec.max.dynamic.partitions=100000;
SET hive.exec.max.dynamic.partitions.pernode=100000;
SET hive.exec.max.created.files=100000;
SET mapreduce.job.queuename=default;
SET hive.exec.submitviachild=true;
SET hive.downloaded.resources.dir=/tmp/$USER/hive_resources;
SET hive.scratch.dir=/tmp/$USER/hive_scratch;
SET hive.server2.enable.impersonation=true;
SET hive.mapred.local.mode=true;
SET hive.auto.convert.join=true;
SET hive.mapjoin.smalltable.filesize=25000000;
SET hive.auto.convert.join.noconditionaltask=true;
SET hive.compute.query.using.stats=true;
SET hive.stats.fetch.column.stats=true;
SET hive.stats.fetch.partition.stats=true;
SET hive.security.authorization

0
车险| 永兴县| 梨树县| 呈贡县| 莱州市| 五指山市| 舞钢市| 广宁县| 芮城县| 牡丹江市| 新竹市| 巴青县| 资源县| 卢氏县| 浦东新区| 瑞安市| 无为县| 平罗县| 临高县| 德庆县| 前郭尔| 阿坝县| 密山市| 西盟| 丹阳市| 玉溪市| 黔南| 四子王旗| 莱西市| 德兴市| 黄冈市| 汉源县| 象州县| 治县。| 铅山县| 霍邱县| 胶州市| 庆安县| 辛集市| 金阳县| 南昌市|