๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’ปTech/๐Ÿ˜hadoop

[SOLVED] UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 80: ordinal not in range(128)

by _viper_ 2020. 7. 6.
๋ฐ˜์‘ํ˜•

๐Ÿšซ ERROR

  • hue์—์„œ hive ์‚ฌ์šฉํ• ๋•Œ ํ•œ๊ธ€์„ insert ํ•˜๋ ค๋ฉด ์ธ์ฝ”๋”ฉ ๊ด€๋ จ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š”๋ฐ์š”.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 80: ordinal not in range(128)

 

๐Ÿ’ก SOLVED

  • hue์—์„œ ์ฟผ๋ฆฌ๋ฅผ ์ฒ˜๋ฆฌํ• ๋•Œ ์‹คํ–‰๋˜๋Š” python ์ธ์ฝ”๋”ฉ ํƒ€์ž…์ด ascii๋กœ ์„ค์ •๋˜์–ด ์žˆ์–ด์„œ ๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค.
  • ํ•ด๋‹น ํŒŒ์ด์ฌ ์Šคํฌ๋ฆฝํŠธ ์ฐพ์•„์„œ ์ˆ˜์ • ํ›„ Hue ์žฌ๊ธฐ๋™ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. (ascii > utf-8)
vi /opt/cloudera/parcels/CDH/lib/hue/build/env/lib/python2.7/site.py
------------------------------------------------------------------------------------------
525     def setencoding():
526     """Set the string encoding used by the Unicode implementation.  The
527     default is 'ascii', but if you're willing to experiment, you can change this."""
529     encoding = "utf-8" # Default value set by _PyUnicode_Init()
------------------------------------------------------------------------------------------