Skip to main content

Posts

Showing posts from September, 2024

ワークフローの合理化:Snowflake アラートを Slack に送信する

Snowflake と Slack の連携でデータエンジニアの仕事がはかどる! Snowflake と Slack を連携させると、データエンジニアの業務効率が大幅に向上します。 その理由を見ていきましょう。 リアルタイムなエラー検知とデバッグ : これまでのようにログを常に監視しなくても、Snowflake でエラーが発生した場合に Slack チャンネルに自動通知を送信するように設定できます。これは、コードのエラーを監視し、すぐに知らせてくれる専任のアシスタントがいるようなものです。迅速な問題解決が可能になります。これは、Webhook を使用することで実現します。Webhook とは、イベントをトリガーとして Snowflake から Slack に送信される自動 HTTP リクエストです。 チーム全体の情報共有 : Slack 連携により、データパイプラインなどの処理状況をチーム全体に共有することもできます。パイプラインが完了、失敗、または問題が発生した場合に、共有チャンネルに通知を送信するように Snowflake を設定できます。これにより、全員が状況を把握できるようになり、不要な進捗確認会議を減らすことができます。 この連携により、Slack がデータワークフロー管理の強力なハブとなり、データエンジニアの業務をよりシンプルかつ生産的にします。 SnowflakeとSlackを統合する方法 Snowflake の NOTIFICATION INTEGRATION と言う機能と Slack の Webhook を利用し Snowflake から Slack にメッセージを送る事が出来ます。 同じ方法を使って、Snowflake から Microsoft Teams と PagerDuty にもメッセージを送るのは可能です。 Slack の使う方の概要が必要なら、この 動画 を見てください。 Webhook は http リクエストです。これは API 呼び出しで、リバース API または Push API と呼ばれることもあります。Webhook の特徴は、何らかのイベントが発生したときにクライアントがサーバーにコールバック (http リクエストを送信) するように指示することです。...

脱初心者! Git ワークフローを理解して開発効率アップ

Git – チーム開発に必須のバージョン管理システムですが、その真価を発揮するにはワークフローの理解が欠かせません。 色々な人は Git の使い方を良く知っていますが、Git を仕事やワークフローに統合する方法を余り良く知らない人もいます。本記事では、Git をワークフローに組み込むことで、開発プロセスがどのように効率化され、チーム全体のパフォーマンスが向上するのかを解説します。Centralized Workflow から Forking Workflow まで、代表的な 9 つのワークフローの特徴を分かりやすく紹介します。それぞれのメリット・デメリット、そして最適なユースケースを理解することで、あなたのプロジェクトに最適なワークフローを選択し、開発をスムーズに進めましょう! Centralized Workflow Feature branching/GitHub Flow Trunk Based Flow Git Feature Flow Git Flow Enhanced Git Flow One Flow GitLab Flow Forking Workflow 分かりやすくするために、同じコンセプトを説明するに一つ以上の図を使った場合があります。 Centralized Workflow 説明: 集中化ワークフローではプロジェクトにおけるすべての変更の単一の入力箇所として中央リポジトリを使用します。デフォルトの開発用ブランチは main と呼ばれ、すべての変更がこのブランチにコミットされます。 集中化ワークフローでは main 以外のブランチは不要です。チームメンバー全員がひとつのブランチで作業し、変更を直接中央リポジトリにプッシュします。 メリット: SVN のような集中型バージョン管理システムから移行する小規模チームに最適。 デメリット: お互いのコードが邪魔になり (お互いの変更を上書きするように)、プロダクション環境にバグをい入れる可能性が高くて、複数のメンバいるチームでこのフローを使いにくい。 地図: graph TD; A[Central Repository] -->|Clone| B1[Developer A's Local Repo] A --...

From Generic to Genius: Fine-tuning LLMs for Superior Accuracy in Snowflake

TL;DR: Cortex Fine-tuning is a fully managed service that lets you fine-tune popular LLMs using your data, all within Snowflake. While large language models (LLMs) are revolutionizing various fields, their "out-of-the-box" capabilities might not always align perfectly with your specific needs. This is where the power of fine-tuning comes into play. As it will be explained in this article, this feature empowers you to take a base LLM and customize it to excel in your particular domain. Here's the brief summary of why you might want to leverage Snowflake's fine-tuning capabilities: Unlocking Domain Expertise : Pre-trained LLMs are trained on massive, general datasets. Fine-tuning allows you to build upon this foundation and train the LLM further using data specific to your field, such as legal documents, medical records, or financial data. This empowers the LLM to understand complex terminology and patterns unique to your domain, leading to more accurate a...

Snowflake の Load History と Copy History の違い

Snowflake におけるデータロードの追跡は、データの健全性とパフォーマンスを維持するために非常に重要です。Load History と Copy History は、過去のデータロードに関する貴重な情報を提供してくれる機能です。これらの機能を理解することで、トラブルシューティング、監査、パフォーマンス分析などを効率的に行うことができます。 Snowflake で Load History を使っても Copy History を使ってもテーブルにロードされた過去のデータの履歴を取得できますが。 何が違うでしょうか。いつどっちを使った方が良いでしょうか。 Load History と Copy History の7違いさ 違いさ1: ビュー vs テーブル関数 Load History は ビュー です。 Copy History と言う テーブル関数 も ビュー もあります。 Load History の使う方の例: USE DATABASE db_1 ; SELECT table_name , last_load_time FROM information_schema . load_history WHERE schema_name = current_schema ( ) AND table_name = 'TABLE_1' ; Copy History ビュー: select file_name , table_name , last_load_time from snowflake . account_usage . copy_history order by last_load_time desc limit 10 ; Copy History テーブル関数: select * from table ( information_schema . copy_history ( TABLE_NAME = > 'TABLE_1' , START_TIME = > DATEADD ( hours , - 1 , CURRENT_TIMESTAMP ( ) ) ...

楽々データパイプライン:Snowflake 動的テーブルで変換をシンプルに

TL;DR:  Dynamic Tablesは、同期機能が組み込まれたテーブルです。Dynamic Tableの定義では、同期元テーブル、同期するデータ、同期頻度を定義します。その後、Snowflakeがデータ同期プロセスを自動的に処理します。 Dynamic Tableは、信頼性が高く自動化された方法でデータを変換するために使用されます。 ソース テーブルを定義し、同期するデータを選択するための SQL クエリを記述し、同期の頻度を設定します。残りの作業は Snowflake が行います。Dynamic Tableの基になる基礎データが変更されると、テーブルが更新されてその変更が反映されます。これらの更新は自動化されており、「更新」と呼ばれます。 Dynamic Tableのソースは複数のテーブル、さらには別のDynamic Tableにすることもできます。 Dynamic Tableの主な利点: 宣言型プログラミング (Declarative programming): 宣言型 SQL を使用して終了状態を定義し、Snowflake にパイプライン管理を処理させることができます。 簡単に切り替え可能: ALTER DYNAMIC TABLE コマンドで、バッチからストリーミングにシームレスに移行できます。パイプラインでデータを更新する頻度を制御できるため、コストとデータの鮮度のバランスをとることができます。 注記: Dynamic Tableの内容はクエリに基づいており、DML 操作を使用して変更することはできません。 Dynamic Table の仕組みを解き明かす Dynamic Tableは、変更を検知するためにベース テーブルの変更追跡に依存します。ベース テーブルで変更追跡がまだ有効になっていない場合、Snowflake は自動的に変更追跡を有効にしようとします。Dynamic Tableを作成するユーザーは、すべての基礎となるオブジェクト/テーブルで変更追跡を有効にするために、 OWNERSHIP 権限を持っている必要があります。 変更の追跡 (Change tracking) テーブルで変更の追跡を有効にするかどうかを指定します。テーブルで変更の追跡が有効になります。この設...

Effortless Data Pipelines: Simplify Transformations with Snowflake Dynamic Tables

TL;DR: Dynamic tables are tables with in-built syncing capability. On the dynamic table definition you define the source tables, what data to sync and how often to sync, after that Snowflake takes care of data syncing process automatically. Dynamic tables are used to transform data in a reliable, and automated way. You define the source table, write SQL query to select what data to sync,and set frequency to sync. Snowflake takes care of the rest. When the underlying data on which the dynamic table is based on changes, the table is updated to reflect those changes. These updates are automated and referred to as a “refresh”. Source of the dynamic table can be multiple tables and even another dynamic table. Main benefits of dynamic tables: Declarative programming: You can define define the end state using declarative SQL and let Snowflake handle the pipeline management. Easy switching: Transition seamlessly from batch to streaming with a single ALTER DYNAMIC TABL...

Snowflake Data Cloud Summit 2024 Summary

2024 念6月の3~6日 San Francisco で Snowflake Data Cloud Summit 2024 が行おいました。主なトピックは AI と Polaris Catalog で、スターゲストが NVidia の CEO Jensen Huang でした。 この記事がその Data Cloud Summit をサマライズします。 AI Snowflake Arctic Arctic AI は Snowflake が自分で開発した AI モデルです Open Source です Snowflake によると Meta の Llama3 8B AI モデルよりもっと良いです リンク Universal Search Universal Search を使用すると、アカウント内のデータベース オブジェクト、Snowflake Marketplace で利用可能なデータ製品、関連する Snowflake ドキュメントのトピック、関連する Snowflake コミュニティ ナレッジ ベースの記事をすばやく簡単に見つけることが出来ます。 Universal Search は、クエリとデータベース オブジェクトに関する情報を理解し、検索語とは異なる名前のオブジェクトを見つけることができる。スペルを間違えたり、検索語の一部だけを入力したりした場合でも、役立つ結果が表示されます。 テーブルの列名によっても、Universal Search は結果を検索出来ます。列名、テーブルの行に書いたおりデータじゃないです。 Document AI PDF, 絵、ビデオ、audio ファイルからデータを抽出出来る AI を Snowflake で使うようになりました。 リンク Snowflake Copilot SQl コードを書くに助ける AI アシスタント です 普通の言葉を SQL コードに変わります: text-to-SQL ML Functions Snowflake でデータを予測する、異常検出、Classification (グルーップング)等を出来るML関数(モデル)が発表しました この ML 関数を直接に使えない、この ML 関数を使って、自分の AI モデルを開発し、そして、開発した AI モデルを使...

How Wendy’s Successfully Penetrated the Japanese Market After Long Struggles

Wendy’s had long struggled to penetrate the Japanese market. Initially the Daiei Group tried to bring Wendy’s to Japan but failed. The next owner of Wendy’s’ Japanese franchise, Zensho Holdings Co. also failed miserably. However, Japanese-American entrepreneur Ernest M. Higa seems to have managed to do the task. This article will discuss the challenges Wendy’s faced when entering the Japanese market, how Ernie Higa addressed those challenges, macro environmental factors that impacted the success of the brand in Japan, future threats the Japanese fast food market is facing , and potential solutions. The prior challenges that Wendy’s faced when they entered the Japanese market There is no one-size-fits-all formula in business, especially when Japan is involved in the conversation. According to Japanese-American entrepreneur Ernie Higa, even if a company has a good product and good pricing, penetrating the Japanese market is more difficult compared to the US’s market. Foreign e...

Streamline Your Workflow: Send Snowflake Alerts to Slack

Do you know integrating Snowflake and Slack can make your life as a data engineer much easier?  Here's why: Real-time error catching and debugging : Instead of constantly checking logs for errors, you can set up Snowflake to automatically ping you in a Slack channel when something goes wrong. This is like having a dedicated assistant who watches for errors in your code and immediately lets you know so you can fix them faster. This is achieved through the use of webhooks, which are essentially automated HTTP requests that Snowflake sends to Slack when triggered by an event. Keep everyone in the loop : Slack integration also means you can keep your entire team informed about the status of data pipelines and other processes. You can configure Snowflake to send notifications to a shared channel whenever a pipeline completes, fails, or encounters an issue. This keeps everyone on the same page and avoids unnecessary status update meetings. This integration turns Slack ...