일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- 코로나19
- 봉준호감독통역
- Bolton
- sharonchoi
- 필리핀사망
- 조현병
- 신종코로나
- 확진자수
- 우한코로나바이러스
- 코로나
- 우한코로나
- 우한
- cnn
- parasite
- 진짜영웅
- 미중
- everybody wants you
- 코로나바이러스
- 정은경 본부장님
- red hearse
- 웨일즈
- 봉준호감독통역사
- 창궐
- 어서와한국은처음이지
- 우한 코로나
- 최성재
- 중국외교부
- wuhan
- 전염병
- 치앙마이
- Today
- Total
목록분류 전체보기 (126)
오지's blog
create or replace function csv_text_chunker(file_url string)returns table (chunk varchar)language pythonruntime_version = '3.9'handler = 'csv_text_chunker'packages = ('snowflake-snowpark-python','pandas', 'langchain')as$$from snowflake.snowpark.types import StringType, StructField, StructTypefrom langchain.text_splitter import RecursiveCharacterTextSplitterfrom snowflake.snowpark.files import Sn..
connection_args = {"user":SNOWFLAKE_IMED_DB_USER ,"private_key":pkb ,"account":SNOWFLAKE_IMED_DB_HOST ,"warehouse":'GCIMED_WH' ,"database":'GCIMED_DB' ,"schema":'DM'}with snow.connect(**connection_args) as conn:
import datetimefrom pytz import UTCoriginal_time = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=UTC).timestamp()now = datetime.datetime.now().timestamp()
JDBC;DRIVER={net.snowflake.client.jdbc.SnowflakeDriver};URL={jdbc:snowflake://xxx.ap-northeast-2.aws.snowflakecomputing.com/?user=xx&password=xxx&warehouse=xxx&db=xx&schema=DM&private_key_file=/app/mstr/MicroStrategy/keys/xx.p8&private_key_pwd=xxx};CLIENT_PREFETCH_THREADS=10;fetchsize=160; 아래로 변경 JDBC;DRIVER={net.snowflake.client.jdbc.SnowflakeDriver};URL={jdbc:snowflake://xxx.ap-northeast-2.aws..
ip를 추가해도 접속이 안되서 알아보니 vpc의 라우팅테이블에도 추가해야 한다.
https://sftp_multiple_files_download_operator.py/ import os from airflow.exceptions import AirflowException from airflow.models import BaseOperator # from airflow.contrib.hooks import SSHHook from airflow.providers.ssh.hooks.ssh import SSHHook from typing import Any class SFTPMultipleFilesDownloadOperator(BaseOperator): template_fields = ('local_directory', 'remote_filename_pattern', 'remote_hos..
SELECT REG_DATE FROM ( SELECT DISTINCT(REPLACE(SUBSTR(CNSL_REG_TME, 1, 10), '-', '')) AS REG_DATE FROM GCWB_WDB.ODS.O_CS_CNSL_HST ) ORDER BY REG_DATE DESC; 하나씩 풀어간다
result = engine.execute(f"SELECT TABLE_NAME FROM information_schema.TABLES WHERE ENGINE LIKE '%InnoDB%' AND TABLE_TYPE='BASE TABLE';").fetchone() ValueError: unsupported format character 'I' (0x49) at index 69 에러 발생 % 대신 %%으로 수정하여 해결 result = engine.execute(f"SELECT TABLE_NAME FROM information_schema.TABLES WHERE ENGINE LIKE '%%InnoDB%%' AND TABLE_TYPE='BASE TABLE';").fetchone()
df = pd.read_sql_query(sql = sql, con = mysql_conn) AttributeError: 'OptionEngine' object has no attribute 'execute' 다음과 같이 변경 필요 df = pd.read_sql_query(sql = text(sql), con = mysql_conn.connect()) reference. https://levelup.gitconnected.com/how-to-fix-attributeerror-optionengine-object-has-no-attribute-execute-in-pandas-eb635fbb89e4 How to Fix AttributeError: ‘OptionEngine’ object has no attrib..
sf_hook = SnowflakeHook(snowflake_conn_id="SNOWFLAKE_CONN_ID") sql = f"SELECT DISTINCT(REPLACE(SUBSTR({date_column_name}, 1, 10),'-', '')) FROM {table_name} WHERE SUBSTR({date_column_name}, 1, 10)='{yesterday.strftime(date_string)}';" conn = sf_hook.get_conn() cursor = conn.cursor() cursor.execute(sql) result = cursor.fetchone() 참고 https://stackoverflow.com/questions/53565834/fetch-results-from-..