2024-10-01ãã1ã¶æéã®è¨äºä¸è¦§
â ã¯ããã« Snowflake 㧠ã¨ã©ã¼ããã£ãã®ã§ åå ã¨ãã©ãã«ã·ã¥ã¼ããæ¸ãã¦ãã ãï¼ãç¾è±¡ Snowflake ã§ã INSERTæã§ä»¥ä¸ããï¼ãã¨ã©ã¼å 容ãã表示 çºçããSQLä¾ CREATE OR REPLACE TABLE demo_table ( ... comment VARCHAR(100) DEFAULT NULL, ... â¦
â ã¯ããã« Jinja2ããã¼ã¹ã«ãªã£ã¦ãã dbt ã使ã£ã¦ã㦠空ç½è¡ãç°å¸¸ã«ã§ãã¦è¦ã¥ããã ã¾ãããããåå ãã¯ä¸æã ããã¡ã¢ãªã¨ã©ã¼ãçºçãã¦ãã ãããã«ãããä½åãªç©ºè¡ã¯ãªãæ¹ãããã®ã§ã調ã¹ã¦ã¿ããã Jinja2 ã«ã¯ãWhitespace Control æ©è½â¦
â ã¯ããã« Kubernetes ã® Namespace (åå空é) ã«ã¤ã㦠å¾ã ã«ã¡ã¢ã£ã¦ããã ç®æ¬¡ ãï¼ãNamespace (åå空é) ãï¼ãé¢é£ãã kubectlã³ãã³ã ï¼ï¼Namespaceä¸è¦§ ï¼ï¼Namespaceä½æ ï¼ï¼Namespaceåé¤ ãï¼ãHello world ãï¼ãNamespace (åå空é) *â¦
â ã¯ããã« https://dk521123.hatenablog.com/entry/2024/01/02/005053 https://dk521123.hatenablog.com/entry/2023/05/07/214515 ãªã©ã§ãã£ãKubernetes ç°å¢æ§ç¯ã§ãã£ããã©ãã«ãã¡ã¢ã£ã¦ãã ç®æ¬¡ ãï¼ãminikube startæã«ã¨ã©ã¼ / Case1 ãï¼ãminiâ¦
â ã¯ããã« https://dk521123.hatenablog.com/entry/2023/11/29/003751 ã®ç¶ãã DBT ã® Macro ä½ã£ãã®ã§ãå®ç¨çãªä¾ãã¡ã¢ãã¦ãã ç®æ¬¡ ãï¼ãmacro ã®å¼æ° ï¼ï¼ããã©ã«ãå¼æ° ãï¼ãä¾å¤ ï¼ï¼ä¾å¤ãã¹ãã¼ãã ãï¼ããµã³ãã« ä¾ï¼ï¼PostgreSQL/Snowflâ¦
â ã¯ããã« VIM ã® ã³ãã³ãã¢ã¼ã ã® ãã使ã Tips ãã¾ã¨ãã¦ããã ç®æ¬¡ ãï¼ãã³ãã³ãã¢ã¼ã ãï¼ãå®ç¨ä¾ ä¾ï¼ï¼Pythonãå®è¡ãã ä¾ï¼ï¼ãã¡ã¤ã«å ãã½ã¼ããã ä¾ï¼ï¼å·®åãã¨ã ä¾ï¼ï¼éè¤åé¤ ä¾ï¼ï¼å²ã¿æåãå ¥ãã ãï¼ãã³ãã³ãã¢ã¼ã * vi â¦
â ã¯ããã« Jinja2㧠æ¢åã®ãªã¹ãããç¹å®ã®æååãé¤å¤ãããã£ããã https://dk521123.hatenablog.com/entry/2024/10/19/000848 ã§è¨è¼ããããã«ããªã¹ãå å 表è¨ããµãã¼ãå¤ã¨ã®ãã¨ã ã£ãã®ã§ã 大åããã£ã¦ãããããã£ã«ã¿ã®rejectã§ãããããâ¦
â ã¯ããã« https://dk521123.hatenablog.com/entry/2024/10/18/001757 https://dk521123.hatenablog.com/entry/2023/11/28/235951 https://dk521123.hatenablog.com/entry/2024/09/11/003301 https://dk521123.hatenablog.com/entry/2018/09/22/142348 çã§â¦
â ã¯ããã« dbt 㧠macro ãä¿®æ£ããå¿ è¦ãããã jinja2ã®åºæ¬çãªææ³äºé ãåãã£ã¦ããªãã£ãã®ã§ ã¾ã¨ãã¦ããã ç®æ¬¡ ãï¼ãåºæ¬ ãï¼ãã³ã¡ã³ãæ ãï¼ãå¤æ° ï¼ï¼å¤æ°å®ç¾© ï¼ï¼å¤æ°åç § ãï¼ãifæ ãï¼ãforæ ï¼ï¼break / continueæ ï¼ï¼loop ãâ¦
â ã¯ããã« PostgreSQLã®COPY FROMã§ã¨ã©ã¼ãmissing data for column xxxxã ã«ãªã£ãã®ã§ã¡ã¢ã ãï¼ãç¾è±¡ PostgreSQL 㧠以ä¸ã®â»ï¼ã®ããã«COPY FROMã使ã£ãé㫠以ä¸ã®ããï¼ãã¨ã©ã¼ã¡ãã»ã¼ã¸ãã表示ãã ãªããPostgreSQLã®ç°å¢ã¯ã以ä¸ã®é¢é£è¨äºâ¦
â ã¯ããã« dbt ã® ããã¥ã¡ã³ãåï¼ãã¼ã¿ãªãã¼ã¸æ©è½ï¼ã使ãããã« ãã¼ã«ã«ç°å¢ãæ´åãã¦ãããdocker ç°å¢ãããã° pip ãããç°¡åã«ä½¿ãããã¨ãåãã£ãã®ã§ã¡ã¢ãã¦ãã å ¬å¼ããã¥ã¡ã³ããã https://docs.getdbt.com/docs/core/installation-oveâ¦
â ã¯ããã« https://dk521123.hatenablog.com/entry/2024/10/09/155708 ã§ã以ä¸ãSQLæãã§ãã©ãã«ã·ã¥ã¼ããã¦ããã®ã ãã QUERY_HISTORYãã¥ã¼ã®START_TIMEã¨END_TIMEï¼ç¹ã«START_TIMEï¼ ã®æé帯ãå ¨ã身ã«è¦ããªãæé帯ã§å®è¡ããã¦ãã¦èª¿ã¹ã¦ã¿ããâ¦
â ã¯ããã« https://dk521123.hatenablog.com/entry/2023/08/03/000817 ã§ãSnowflakeã®ãã©ãã«ã·ã¥ã¼ãã£ã³ã°ã®ããã®çµ±è¨æ å ±ãåå¾ããæ¹æ³ã æ±ã£ã¦ãããã ä»æ¥ãQUERY_HISTORY ãã¥ã¼ã使ã£ã¦ããã©ãã«ã·ã¥ã¼ãããã®ã§ æ¹ãã¦ãå¥åã§æ±ã£ã¦ã¿ããâ¦
â ã¯ããã« https://dk521123.hatenablog.com/entry/2017/04/01/235355 ã®ç¶ãã ä½æ¥ã§ãS3ãã±ããå ã®ãã¡ã¤ã«å®¹éã調ã¹ãå¿ è¦ãåºã¦ã㦠ãã®ãã¡ã¤ã«ã®æéæ¨ç§»ãä½µãã¦èª¿ã¹ããã¨ã¨ãªã£ãã ã¡ã¾ã¡ã¾Management Consoleä¸ããæä½æ¥ã§èª¿ã¹ã¦ããã®ã â¦
â ã¯ããã« https://dk521123.hatenablog.com/entry/2024/10/05/234219 ã®ç¶ãã ååã®è¨äºã¯ããBackfillãã ã£ãã®ã§ ä»åã¯ããCatchupããéä¸ã§åãä¸ãã ç®æ¬¡ ãï¼ãCatchup ãï¼ãè¨å®æ¹æ³ ï¼ï¼DAG ï¼ï¼airflow.cfg ãï¼ãHello World for Catchup â¦
â ã¯ããã« ä¹ ãã¶ãã«ãAirflow ã«ã¤ãã¦æ±ã£ã¦ããã ãªã«ããªã®ããã«ãBackfillãã£ã¦ãã®ãå¦ãã ã®ã§ ã¡ã¢ãã¦ãã ç®æ¬¡ ãï¼ãäºåç¥èï¼DAG ï¼ï¼start_date ï¼ï¼end_date ï¼ï¼schedule_interval ãï¼ãBackfill ï¼ï¼backfill ã³ãã³ã ï¼ï¼ã³ãã³ãâ¦
â ã¯ããã« æè¿ãEmail ã®å¤å®ãã¹ããè¡ã£ã¦ã㦠ä¸æ£ãªEmailã¢ãã¬ã¹ã¨å¤å®ããã¢ãã¬ã¹ã«å¯¾ã㦠æ¬å½ã«ããä¸æ£ï¼ã£ã¦ãã¨ããã£ãã®ã§ã ä¹ ãã¶ãã« RFC ã調ã¹ã¦ã¿ãã ãããããã¨çµæ§ã¾ãèµ·ããããªã®ã§è¨é²ãã¦ããã ã¿ã¤ãã«ãæ£è¦è¡¨ç¾ã ããã¡â¦
â ã¯ããã« å°ãã¿ã æè¿å°ãã¿ã°ã£ãã ãããã Snowflake ã® SELECT ... EXCLUDE ãä½æ°ã«ä¾¿å©ã ã£ãã®ã§ ã¡ã¢ãã¦ããã ç®æ¬¡ ãï¼ãSELECT ... EXCLUDE ãï¼ãå©ç¹ ãï¼ãå©ç¨ä¾ ï¼ï¼CREATE TABLE SELECT ã§å©ç¨ ãï¼ãSELECT ... EXCLUDE * EXCLUDEã§â¦