๐ปTech160 MySQL, MariaDB ํ๊ธ ๊นจ์ง ํ์ ํด๊ฒฐ(Hive Metastore) Hive์์ desc๋ก ํ ์ด๋ธ ์กฐํ ์ ํ๊ธ comment๊ฐ ๊นจ์ง๋ ๊ฒฝ์ฐ๊ฐ ์๋๋ฐ, metastore DB ํ๊ธ ์ค์ ์ด ์ ๋ผ์ ๊ทธ๋ ์ต๋๋ค. ์๋ ์กฐ์น ๋ฐฉ๋ฒ์ ๋๋ค. MySQL 1. my.cnf ์์ my.cnf ํ์ผ ์ด์ด์ ์๋๋ด์ฉ์์ ์๋๊ฒ๋ค์ ์ถ๊ฐํด ์ฃผ์ธ์. [root@localhost]$ vi /etc/my.cnf ---------------------------------------------------------- [client] character-sets-dir = utf8 [mysqld] init_connect=SET collation_connection = utf8_general_ci init_connect=SET NAMES utf8 character-set-server = utf8 col.. 2023. 8. 21. [Hive,Impala] sqlํ์ผ ์คํํ ๋ ๋ณ์ ๋๊ธฐ๋ ๋ฐฉ๋ฒ โพ Hive hive 3.0๋ถํฐ๋ hiveconf ์ฌ์ฉ์ด ์ ๋ผ์ hivevar๋ฅผ ์ฌ์ฉํฉ๋๋ค. -hivevar ์ฌ์ฉ hive --hivevar dt=20190923 -f hive.sql -hive.sql ํ์ผ ๋ด์์ ๋ณ์ ๋ฐ๋ ๋ฐฉ๋ฒ (ํํฐ์ ์์ฑ ์์ ) ALTER TABLE dbnm.tblnm ADD PARTITION(dt='${hivevar:dt}'); โพ Impala impala-shell -k --var="dt=20230821" -f impala.sql 2023. 8. 21. [NiFi] FlowFile "Details" ๊ฐ attribute ์ถ์ถ ๋ฐฉ๋ฒ Details ํญ์์ Filename, File Size ๋ผ๋ ๊ฐ์ attribute๋ก ์ถ์ถํ๋ ๋ฐฉ๋ฒ์ ๋๋ค. UdateAttribute ํ๋ก์ธ์๋ฅผ ์์ฑํ๊ณ ์๋์ ๊ฐ์ด ์ค์ ํด์ฃผ๋ฉด ํด๋น ๊ฐ์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค. ์์ฑ์ด๋ฆ: my_file_name ์์ฑ๊ฐ: ${filename} ์์ฑ์ด๋ฆ: my_file_size ์์ฑ๊ฐ: ${fileSize} 2023. 4. 21. [๋ฆฌ๋ ์ค] JupyterHub ์ค์น ๋ฐฉ๋ฒ ๋ฆฌ๋ ์ค ํ๊ฒฝ (CentOS 7, Python3.8)์์ JupyterHub ์ค์น ๋ฐฉ๋ฒ ๊ณต์ ํฉ๋๋ค. ์ค์น ์ Jupyter ์ฉ์ด ๊ด๋ จํ์ฌ ๊ฐ๋ตํ๊ฒ ์ ๋ฆฌ ํ๊ฒ ์ต๋๋ค. Jupyter Notebook ๋ํํ Python Interpreter๋ก ์น ํ๊ฒฝ์์ Python ์ฝ๋ ์์ฑ ๋ฐ ์คํํ๋ ๊ฐ๋ฐ ํ๊ฒฝ(tool) Jupyter Lab Jupyter Notebook์ ์ฐจ์ธ๋ ๋ฒ์ ์ผ๋ก ์ฌ์ฉ์ ํธ์ ๊ธฐ๋ฅ๋ค์ด ์ถ๊ฐ๋จ ๋ค์ค์ฐฝ ์ง์, csv/pdf ๋ฑ ํ์ผ๋ ์ด ์ ์์ด์ ๋์๋ณด๋์ฒ๋ผ ์ฌ์ฉ ๊ฐ๋ฅ JupyterHub ๋ฉํฐ ์ฌ์ฉ์ ํ๊ฒฝ์์ Jupyter Notebook/Lab์ ์ฌ์ฉ ๐ ์ค์น ๋ฐฉ๋ฒ 1. os ํจํค์ง ์ค์น yum install –y nodejs yum install openssl 2. nodejs ํจํค์ง ์ค์น โพ.. 2023. 4. 13. [python] pysqlite3 ์ค์น ์ค๋ฅ ํด๊ฒฐ ๐ซ ERROR src/connection.h:34:21: fatal error: sqlite3.h: No such file or directory #include "sqlite3.h" compilation terminated. error: command 'gcc' failed with exit status 1 ๐ก SOLVED $ yum install -y libsqlite3x-devel $ pip3 install pysqlite3 2023. 4. 12. [python] sasl ์ค์น ์ค๋ฅ ํด๊ฒฐ sasl ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น ๊ณผ์ ์์ ์๋์ ๊ฐ์ ์ค๋ฅ ํด๊ฒฐ ๋ฐฉ๋ฒ๋ค์ ๋๋ค. ๋ฆฌ๋ ์ค ํจํค์ง ์ค์น๊ฐ ํ์ํ๋ค์. ๊ฒฐ๊ณผ์ ์ผ๋ก ์๋ ๋ช ๋ น์ด ์ํํ์ฌ ํจํค์ง ์ค์นํด์ฃผ๋ฉด ๋ฉ๋๋ค. ๐ซ ERROR gcc: error trying to exec 'cc1plus': execvp: No such file or directory sasl/saslwrapper.h:22:23: fatal error: sasl/sasl.h: No such file or directory ๐ก SOLVED $ yum install -y gcc-c++ cyrus-sasl-devel $ pip3 install sasl 2023. 3. 22. hive/impala udf ๋ฑ๋ก ๋ฐฉ๋ฒ hdfs ํ์ผ ์ ๋ก๋ ํ impala, hive SQL์์ ๊ฐ๊ฐ function ์์ฑํด์ฃผ๊ณ , function์ด db ๊ธฐ์ค์ผ๋ก ์์ฑ๋๊ธฐ ๋๋ฌธ์, db๋ช ์๋ฅผ ํด์ค์ผ ํฉ๋๋ค. โพ Impala create function default.count_date(string) returns string location 'hdfs:///user/hive/udf/udf-0.1.0.jar' symbol='udf.count_date'; โพ Hive create function default.count_date as 'udf.count_date' using jar 'hdfs:///user/hive/udf/udf-0.1.0.jar'; 2023. 1. 16. [Hive] multi delimiter ํ ์ด๋ธ DDL create external table txt_test( a string, b string, c string, d string, e string ) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.MultiDelimitSerDe' WITH SERDEPROPERTIES ("field.delim"="|\001|") LOCATION 'hdfs://name/tmp/test'; 2023. 1. 11. ์ด์ 1 2 3 4 5 6 ยทยทยท 20 ๋ค์