Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
SnowflakeにMySQLとJOINする機能を 実装する
Search
Kurochan
April 04, 2021
Technology
770
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SnowflakeにMySQLとJOINする機能を 実装する
#SnowVillage LIVE 004
https://www.youtube.com/watch?v=zY7z2IEtqCc
Kurochan
April 04, 2021
More Decks by Kurochan
See All by Kurochan
ABEMAのバグバウンティの取り組み
kurochan
1
1.2k
2026年の個人的テーマ: 「計算機を燃やせ🔥」
kurochan
1
220
つなぐ、届ける、変える- コンテンツ配信の最前線ト——ク
kurochan
0
190
サイバーエージェント流クラウドコスト削減施策「みんなで金塊堀太郎」
kurochan
4
3.4k
AWS Elemental MediaPackageと格闘🤼
kurochan
2
150
サイバーエージェントでのSlack活用事例 @ 2025
kurochan
5
300
15年入社者に聞く! これまでのCAのキャリアとこれから
kurochan
1
410
入門 電気通信事業者
kurochan
13
5.9k
AWS x さくらのクラウドのハイブリッドクラウドによる安価なフレッツ閉域網接続の実装
kurochan
10
6.5k
Other Decks in Technology
See All in Technology
ScotSecure West 2026 - Glasgow
raybugg
0
210
Amazon Bedrock Agents ClassicからAmazon Bedrock AgentCoreへ移行した際、ガードレール設定が2箇所に割れた話
matsunobu
0
160
Account Factory for Terraformによる 標準化されたアカウント発行の自動化
pensuke628
0
120
なぜAI任せのゲームは面白くならないのか?
hirohasuyoutube
0
330
KanaAI
shreyas1009
0
130
PQC移行の今 -- IETF からみた現在地
satokan
4
680
VS Code × GitHub Copilot での Fabric 開発
ryomaru0825
1
190
LT:「このままでいいのかな?」から一歩踏み出した私のデータキャリア選択〜社会人3年目に上京を決意したリアル〜Snowflake女子会 vol.8
snowwmn0824
0
120
AI Native Platform Engineering 〜PlatformとAgileで“作る速さ”を“価値”へ〜
uya116
0
500
MCPゲートウェイを作って運用してわかったこと — Agent時代の権限管理の現在地
mtpooh
5
1.2k
可視化から始めたAI駆動開発_ochi_ver1.01 / AI-Driven Development Starting with Visualization_ver1.01
yayoi_dd
0
110
大阪オフィスに Unitree Go2 がやってきたので Physical AI やってみた
dafujii
0
150
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
Exploring anti-patterns in Rails
aemeredith
4
520
Designing for Timeless Needs
cassininazir
1
510
How to Think Like a Performance Engineer
csswizardry
28
2.8k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
730
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
330
4 Signs Your Business is Dying
shpigford
187
23k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
530
The World Runs on Bad Software
bkeepers
PRO
72
12k
BBQ
matthewcrist
89
10k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
390
Transcript
SnowflakeʹMySQLͱJOIN͢ΔػೳΛ ࣮͢Δ גࣜձࣾαΠόʔΤʔδΣϯτ AIࣄۀຊ෦ ࠇ࡚ ༏ଠ (@kuro_m88)
ࠇ࡚ ༏ଠ • גࣜձࣾαΠόʔΤʔδΣϯτ Dynalyst ։ൃऀ • ࠂ৴γεςϜͷόοΫΤϯυΛ࡞͍ͬͯ·͢ • ීஈAWS
x Scalaͷࣄ͕ଟ͍Ͱ͢ @kuro_m88 @kurochan
Federated QueryΛ࡞Γ͍ͨ
Federated Query • Redshiftʹࡌ͞Ε͍ͯΔͭ • Redshift͔ΒPostgreSQLʹΫΤϦΛ͛Δ͜ͱ͕Ͱ͖Δ • ͜Ε͕Ͱ͖Δͱɺ ϩάσʔλͱϑΝΫτσʔλͷ ݁߹͕Ͱ͖ͨΓͯ͠خ͍͠
• MySQL·ͩbeta
ཁ͢Δʹ͜Ε͕Γ͍ͨ
SnowflakeͰΓ͍ͨ • Snowflakeʹຬ͍ͯ͠Δ͕ɺRedshift͕ત·͍͠ͱࢥ͏ػೳΛͻͱ্ͭ͛ Δͱ͢ΕFederated Query • ݱঢ়ͦͷΑ͏ͳػೳͳ͍͠ɺಉҰVPCʹSnowflakeͱRDS͕ଘࡏ͠ͳ͍ͨ Ί௨৴͢Δͷͦ͠͏… • ત·͍͠ͷͰͳΜͱ͔ͦΕͬΆ͍ͷΛࣗ࡞͍ͨ͠
• ࣮ͯ͠Έ·ͨ͠ • CyberAgent / snowflake-aws-mysql-connector • https://github.com/CyberAgent/snowflake-aws-mysql-connector
Federated QueryΛ ࣮͢Δ
Snowflakeͱ֎෦αʔϏεͷ࿈ܞ • SnowflakeʹExternal Functionͱ͍͏ػೳ͕͋ΓɺSQLͷؔͱͯ͠AWS LambdaͷؔΛݺͼग़͢͜ͱ͕Մೳ • Lambda FunctionͰRDSʹΞΫηεͯ͠ɺͦͷ݁ՌΛProxy͢ΕSnowflake ͔ΒಈతʹΫΤϦ͕͛ΒΕΔͷͰͳ͍͔…ʁ •
ͱΓ͋͑ͣLambda Function + API Gateway
Lambda Function • ΄΄proxyͯ͠Δ͚ͩ • Lambda FunctionͷҾ͔ΒSQLͷจࣈྻΛऔΓग़͢ • DBʹΫΤϦ͢Δ •
ϨεϙϯεΛܗ͢Δ
LambdaͷϨεϙϯεαΠζ੍ݶ • Lambda FunctionͷϨεϙϯε6MB·Ͱ • ༗ݶͳͷͰϨεϙϯεΛѹॖͯ͠Αͦ͞͏ • Ϩεϙϯε͕େ͖ͦ͏ͩͬͨΒѹॖ͢Δ͜ͱʹ (Ϩεϙϯεʹѹॖ͔ͨ͠Ͳ͏͔ͷϑϥάೖΕ͓ͯ͘)
SnowflakeͷUDF • UDF = User Defined Function • UDFSQLͷଞʹJavascript͕ॻ͚Δ •
UDFʮߦʯΛฦؔ͢ • External FunctionʮߦʯΛฦؔ͢ • ࠓճSnowflakeͷςʔϒϧͱRDSͷςʔϒϧΛJOIN͍ͨ͠…
UDTF • User Defined Table Function • ʮςʔϒϧʯΛฦؔ͢ • UDF:
select my_function(); • UDTF: select * from table(my_table_function()); • ͋ͱؔΛςʔϒϧؔʹม͢Δ͕ؔ͋Εɺ External FunctionΛUDTFͰϥοϓ͢Ε͍͍ͣ…ʂ
ؔΛςʔϒϧؔʹม͢Δؔ: flattenؔ
ؔΛςʔϒϧؔʹม͢Δؔ: flattenؔ
API IntegrationΛઃఆ͢Δ • API Gateway(Lambda)Λݺͼग़͢ํ๏Λఆٛ͢Δ
External FunctionΛఆٛ͢Δ • Snowflake͔ΒAPI GateawyΛݺͼग़͢
UDTFΛఆٛ͢Δ • UDTFͷதͰExternal FunctionΛݺΜͰɺ݁ՌΛflatten͢Δ
UDTFͷதͷSQL • ΫΤϦ݁Ռ͕gzipѹॖ͞Ε͍ͯͨΒల։͠ɺ ૉͷJSONͰ͋Εͦͷ··ύʔε͢Δ
͍ํͷΠϝʔδ
͍ํͷΠϝʔδ
None