当前位置:网站首页>Flink和Spark中文乱码问题
Flink和Spark中文乱码问题
2022-08-05 05:14:00 【IT_xhf】
Flink中文乱码
近期开发Flink CDC 读取mysql数据写入到HDFS,发现写入中文乱码,排查了数据库编码和文件编码都没有问题,后来网上查了一些资料,修改flink.conf文件,新增如下内容
env.java.opts: -Dfile.encoding=UTF-8
Spark中文乱码
也排查了数据库编码和文件编码没有问题,在程序启动参数中新增–conf spark.executor.extraJavaOptions=“-Dfile.encoding=UTF-8” --conf spark.driver.extraJavaOptions=“-Dfile.encoding=UTF-8”
完整例子
spark-submit \
--master yarn \
--conf spark.executor.extraJavaOptions="-Dfile.encoding=UTF-8" \
--conf spark.driver.extraJavaOptions="-Dfile.encoding=UTF-8" \
--deploy-mode cluster \
--class com.vesoft.nebula.exchange.DBTest \
--driver-cores 1 \
--driver-memory 512M \
--num-executors 2 \
--executor-cores 2 \
--executor-memory 2G \
--queue default nebula-exchange_spark_2.4-3.0-SNAPSHOT.jar
或者在spark.conf中配置这两个参数
spark.executor.extraJavaOptions="-Dfile.encoding=UTF-8"
spark.driver.extraJavaOptions="-Dfile.encoding=UTF-8"
边栏推荐
- [Decoding tools] Some online tools for Bitcoin
- What are the characteristics of the interface of the physical layer?What does each contain?
- "PHP8 Beginner's Guide" A brief introduction to PHP
- Pandas(五)—— 分类数据、读取数据库
- ES6基础语法
- The difference between the operators and logical operators
- Map、WeakMap
- 【读书】长期更新
- flink部署操作-flink standalone集群安装部署
- NodeJs接收上传文件并自定义保存路径
猜你喜欢

数据库 单表查询

第5讲 使用pytorch实现线性回归

2022 Hangzhou Electric Multi-School 1st Session 01
![[Go through 9] Convolution](/img/84/e6d99793aacf10a7b099f60bcaf290.png)
[Go through 9] Convolution

拿出接口数组对象中的所有name值,取出同一个值

【过一下6】机器视觉视频 【过一下2被挤掉了】

CAP+BASE

【NFT开发】设计师无技术基础保姆级开发NFT教程在Opensea上全套开发一个NFT项目+构建Web3网站

Using pip to install third-party libraries in Pycharm fails to install: "Non-zero exit code (2)" solution
![[Go through 8] Fully Connected Neural Network Video Notes](/img/0a/8b2510b5536621f402982feb0a01ef.png)
[Go through 8] Fully Connected Neural Network Video Notes
随机推荐
[Study Notes Dish Dog Learning C] Classic Written Exam Questions of Dynamic Memory Management
【零基础开发NFT智能合约】如何使用工具自动生成NFT智能合约带白名单可Mint无需写代码
【记一下1】2022年6月29日 哥和弟 双重痛苦
【过一下12】整整一星期没记录
What are the characteristics of the interface of the physical layer?What does each contain?
Lecture 3 Gradient Tutorial Gradient Descent and Stochastic Gradient Descent
JSX基础
【Transfer】What is etcd
Flink 状态与容错 ( state 和 Fault Tolerance)
ES6基础语法
【过一下9】卷积
[Go through 4] 09-10_Classic network analysis
[Go through 10] sklearn usage record
ES6 生成器
Matplotlib(三)—— 实践
Difference between for..in and for..of
【过一下4】09-10_经典网络解析
【过一下10】sklearn使用记录
Calling Matlab configuration in pycharm: No module named 'matlab.engine'; 'matlab' is not a package
学习总结week2_3