Using Snowpark to read data

Whether your data sits in operational databases or arrives as files, Snowpark gives you a simple, Python-first way to pull it in, convert it to a DataFrame, and view it in Snowflake tables, so you can model, transform, and analyze without context switching.

使用 Snowpark Python DB-API 从外部源读取数据

Use standard Python DB-API 2.0 drivers to pull data from external databases (SQL Server, Oracle, PostgreSQL, MySQL, Databricks) directly into a Snowpark DataFrame. Snowpark Python DB-API can run from your client (local mode) or inside Snowflake using stored procedures or notebooks (with external access integration). The result behaves like any other DataFrame you can use to join, transform, and write to Snowflake tables. For more information, see Using the Snowpark Python DB-API.

Reading data from external sources using Snowpark Python JDBC

Use standard JDBC drivers provided by you to pull data from external databases directly into a Snowpark DataFrame. Snowpark Python JDBC can run from your client or inside Snowflake using stored procedures or notebooks. A UDTF is created to ingest your target data. The result behaves like any other DataFrame you can use to join, transform, and write to Snowflake tables. For more information, see 使用 Snowpark Python JDBC.

备注

要使用此功能,请将 JDBC 驱动程序上传到暂存区,配置外部访问集成,并确保 Snowflake 能够访问源端点。

使用 Snowpark XML RowTag Reader 从 XML 文件读取数据

Use Snowpark XML to read large staged XML files efficiently: the reader splits the file on rowTag, loads each match as one row, and maps child elements into VARIANT columns (preserving the nested structure) for immediate querying with Snowpark or SQL. You can also validate each row against an XSD with PERMISSIVE (quarantine invalid rows in _corrupt_record) or FAILFAST behavior. The output is a standard DataFrame you can transform and save to tables. For more information, see Using the Snowpark XML RowTag Reader.

语言: 中文