본문 바로가기

IT 자료202

AWS GLUE에서 다른 GLUE 실행하기 AWS GLUE에서 다른 GLUE 실행하기 import boto3import timefrom botocore.exceptions import ClientErrordef wait_for_job_completion(glue_client, job_name, run_id): """ Wait for an AWS Glue job to complete and return the status. Args: glue_client: Boto3 Glue client job_name: Name of the Glue job run_id: ID of the specific job run Returns: str: Final status of.. 2025. 4. 8.
redshift 행분할, 쪼개기(콤마) 예제 레코드의 특정 값으로 행을 여러개 분할하는 방법 WITH TMP AS ( SELECT 'A,B,CD'::varchar AS VAL),NUMS AS ( /* 최대 분할 개수 */ SELECT 1 AS N UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5)select a.val , b.n , SPLIT_PART(VAL, ',', N) as testfrom TMP ajoin NUMS b on (SPLIT_PART(VAL, ',', N)) != ''; 2024. 12. 2.
postgresql(redshift) 테이블 코멘트 확인 postgresql(redshift) 테이블 코멘트 확인 SELECT n.nspname AS schema_name, c.relname AS table_name, a.attname AS column_name, pg_get_expr(d.adbin, d.adrelid) AS column_default, t.typname AS data_type, CASE WHEN a.attnotnull THEN 'NOT NULL' ELSE 'NULL' END AS null_constraint, col_description(a.attrelid, a.attnum) AS column_commentFROM pg_catalog.pg_attribute a .. 2024. 7. 9.
파이썬 print에 시간표시 파이썬 print에 시간표시 (+9시간) from datetime import datetime, timedeltadef log_message(message): current_time = datetime.now() adjusted_time = current_time + timedelta(hours=9) formatted_time = adjusted_time.strftime("%Y-%m-%d %H:%M:%S") print(f"[{formatted_time}] {message}") log_message('테스트') 2024. 7. 4.