Package com.snowflake.snowpark_java
Class DataFrame
java.lang.Object
com.snowflake.snowpark_java.DataFrame
A Snowpark DataFrame: a PLAN, not a result.
session.sql(...) submits nothing — the statement runs when an action asks for its rows, and
runs AGAIN for each further action. Measured on live: a handler that calls collect() twice on
session.sql("INSERT INTO sink VALUES (1)") leaves two rows, and count() counts as an
action alongside collect(). A handler that never calls an action submits nothing at all, which
is why the same body that appears to create a temporary table under owner's rights is silently a no-op
there. Executing inside sql() — as this stub used to — made every such handler do real work
here and nothing on Snowflake, a divergence that hides rather than fails.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAggregate the whole frame, with no grouping.A column of this frame, by name.Row[]collect()The rows, as Snowpark'sRowrather than the engine's own — a handler callsrows[0].getString(0), which the engine's row has no method for.longcount()distinct()Snowflake'sSELECT * EXCLUDE (…)carries this one directly.Keep the rows the condition holds for.first()The first row, or empty when the frame has none.Row[]first(int count) The firstcountrows.The engine's own result, for Frostlake's plumbing rather than for a handler.limit(int count) Rename one column, leaving the rest and their order alone —SELECT * RENAME (…).schema()The column names and types, as Snowpark describes them.Project the given columns — a PLAN operation, so nothing runs until an action asks for rows.ORDER BY, taking the ordering columns asasc()/desc_nulls_last()etc.Snowpark's spelling offilter(com.snowflake.snowpark_java.Column); both exist on the real DataFrame.withColumn(String columnName, Column value) Append a computed column, keeping the ones already there.
-
Constructor Details
-
DataFrame
A frame over rows that have already been produced.
-
-
Method Details
-
select
Project the given columns — a PLAN operation, so nothing runs until an action asks for rows. This andfilter(com.snowflake.snowpark_java.Column)are the paths a handler uses aColumnthrough; the real API has no way to ask a Column for its SQL, so building one is only ever a means to one of these. -
filter
Keep the rows the condition holds for. A plan operation, likeselect(com.snowflake.snowpark_java.Column...). -
where
Snowpark's spelling offilter(com.snowflake.snowpark_java.Column); both exist on the real DataFrame. -
sort
ORDER BY, taking the ordering columns asasc()/desc_nulls_last()etc. -
limit
-
distinct
-
drop
Snowflake'sSELECT * EXCLUDE (…)carries this one directly. -
union
-
unionAll
-
except
-
intersect
-
crossJoin
-
withColumn
Append a computed column, keeping the ones already there. -
rename
Rename one column, leaving the rest and their order alone —SELECT * RENAME (…). -
agg
Aggregate the whole frame, with no grouping. -
col
A column of this frame, by name. -
first
The first row, or empty when the frame has none. An ACTION: it runs the plan. -
first
The firstcountrows. An ACTION. -
collect
The rows, as Snowpark'sRowrather than the engine's own — a handler callsrows[0].getString(0), which the engine's row has no method for. -
schema
The column names and types, as Snowpark describes them. -
count
public long count() -
getResultSet
The engine's own result, for Frostlake's plumbing rather than for a handler. Its return type does not exist on Snowflake, so — unlike a method returning only JDK types — no portable handler can be written against it by accident.
-