0% found this document useful (0 votes)
8 views1 page

Quick Reference - Snowpark Java APIs For SQL Commands - Snowflake Documentation

Uploaded by

demorepo99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Quick Reference - Snowpark Java APIs For SQL Commands - Snowflake Documentation

Uploaded by

demorepo99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

4/29/24, 3:05 PM Quick reference: Snowpark Java APIs for SQL commands | Snowflake Documentation

Developer Snowpark API Java Map of Java APIs to SQL Commands


Quick reference: Snowpark Java APIs for
SQL commands
This topic provides a quick reference of some of the Snowpark APIs that
correspond to SQL commands.
(Note that this is not a complete list of the APIs that correspond to SQL
commands.)
Performing queries
Selecting columns
To select specific columns, use select.
Example of a SQL Statement Example of Snowpark Code

SELECT id, name DataFrame df =


FROM session.table("sample_product_data");
sample_product_data;
DataFrame dfSelectedCols =
df.select(Functions.col("id"),
Functions.col("name"));

dfSelectedCols.show();

Renaming columns
To rename a column, use as or alias.
Example of a SQL Statement Example of Snowpark Code

SELECT id AS DataFrame df =
item_id FROM session.table("sample_product_data");
sample_product_data;
DataFrame dfRenamedCol =
https://docs.snowflake.com/en/developer-guide/snowpark/java/sql-to-snowpark 1/1

You might also like