Skip to main content

aidp-snowflake

Read Snowflake from an AIDP notebook through the AIDP `aidataplatform` Spark format handler. Use when the user mentions Snowflake, Snowflake warehouse, Basic authentication, KeyPair authentication, private.key.file, or private.key.content. Snowflake writes are not supported in AIDP 4.0.

설치로 이동

소스 정보

저장소
oracle-samples/oracle-aidp-samples
최근 소스 활동
2026년 7월 10일 22:17
감지된 SKILL.md 언어
영어
스타
46
포크
30

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
aidp-snowflake
description
Read Snowflake from an AIDP notebook through the AIDP `aidataplatform` Spark format handler. Use when the user mentions Snowflake, Snowflake warehouse, Basic authentication, KeyPair authentication, private.key.file, or private.key.content. Snowflake writes are not supported in AIDP 4.0.
allowed-tools
Read, Write, Edit, Bash
# `aidp-snowflake` — read Snowflake via AIDP `aidataplatform` Use the built-in AIDP Snowflake connector (`type=SNOWFLAKE`). It supports Basic and KeyPair authentication, direct ingestion reads, external-catalog reads, and SQL pushdown. **Do not generate write code for Snowflake in the 4.0 release.** ## When to use - Read from a Snowflake warehouse in an AIDP notebook. - Mentioned: "Snowflake", "warehouse", "private.key.file", or "KeyPair". ## When NOT to use - For a generic JDBC-only source that has no dedicated connector → [`aidp-jdbc-custom`](../aidp-jdbc-custom/SKILL.md). - For a Snowflake write request, explain that the 4.0 AIDP Snowflake connector is read-only. ## Basic authentication read ```python import os from oracle_ai_data_platform_connectors.aidataplatform import ( AIDP_FORMAT, aidataplatform_options, ) opts = aidataplatform_options( type="SNOWFLAKE", host=os.environ["SNOWFLAKE_HOST"], port=443, database_name=os.environ["SNOWFLAKE_DATABASE"], user=os.environ["SNOWFLAKE_USER"], password=os.environ["SNOWFLAKE_PASSWORD"], schema=os.environ["SNOWFLAKE_SCHEMA"], table=os.environ["SNOWFLAKE_TABLE"], extra={ "authentication.method": "Basic", "warehouse": os.environ["SNOWFLAKE_WAREHOUSE"], "role": os.environ.get("SNOWFLAKE_ROLE", ""), }, ) df = spark.read.format(AIDP_FORMAT).options(**opts).load() df.show(5) ``` ## Key-pair authentication read Set one of `private.key.file` or `private.key.content`. Use `private.key.pass.phrase` only for an encrypted key. ```python opts = aidataplatform_options( type="SNOWFLAKE", host=os.environ["SNOWFLAKE_HOST"], port=443, database_name=os.environ["SNOWFLAKE_DATABASE"], user=os.environ["SNOWFLAKE_USER"], schema=os.environ["SNOWFLAKE_SCHEMA"], table=os.environ["SNOWFLAKE_TABLE"], extra={ "authentication.method": "KeyPair", "warehouse": os.environ["SNOWFLAKE_WAREHOUSE"], "role": os.environ.get("SNOWFLAKE_ROLE", ""), "private.key.file": os.environ["SNOWFLAKE_PRIVATE_KEY_FILE"], "private.key.pass.phrase": os.environ.get("SNOWFLAKE_PRIVATE_KEY_PASSPHRASE", ""), }, ) df = spark.read.format(AIDP_FORMAT).options(**opts).load() df.show(5) ``` To supply the key inline, replace `private.key.file` with `private.key.content`; never hard-code a private key in a notebook. ## External-catalog read Create the Snowflake external catalog in **Master Catalogs** first. You can then use a three-part table name or reuse its connection with `catalog.id`. ```python catalog_df = spark.table("<CATALOG_NAME>.<SCHEMA>.<TABLE_NAME>") catalog_df.show(5) catalog_id_df = (spark.read.format(AIDP_FORMAT) .option("catalog.id", "<CATALOG_ID>") .option("schema", "<SCHEMA>") .option("table", "<TABLE_NAME>") .load()) catalog_id_df.show(5) ``` ## Pushdown SQL Use `pushdown.sql` to execute a source query in Snowflake. ```python pushdown_df = (spark.read.format(AIDP_FORMAT) .options(**opts) .option("pushdown.sql", "SELECT * FROM <SCHEMA>.<TABLE_NAME> LIMIT 10") .load()) pushdown_df.show(5) ``` ## Gotchas - **Read-only in 4.0.** Do not use `df.write`, `saveAsTable`, `insertInto`, or `write.mode` with Snowflake. - **Authentication values are case-sensitive.** Use `Basic` or `KeyPair`. - **Warehouse is required.** Set `warehouse` for both authentication modes; `role` is optional. - **Network reachability.** The AIDP cluster needs outbound HTTPS access to the Snowflake account endpoint. ## References - Official sample: [Snowflake notebook](https://github.com/oracle-samples/oracle-aidp-samples/blob/main/data-engineering/ingestion/Read_Only_Ingestion_Connectors/Snowflake.ipynb)
GitHub에서 보기