Dataset
A distributed collection of rows. A Dataset is lazy: transformations build up a protobuf logical plan, and nothing executes until an action (e.g. collect, show, count) is called.
Mirrors the public surface of org.apache.spark.sql.Dataset over the Spark Connect protocol: operations that keep the row type (filtering, sorting, set operations, repartitioning, ...) return a Dataset[T], while operations that change the schema return a DataFrame.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Returns a new Dataset where each record is mapped to type U via its Encoder. This is a purely client-side reinterpretation (no server-side closure), so it works over Spark Connect.
Returns a new Dataset where each record is mapped to type U via its Encoder. This is a purely client-side reinterpretation (no server-side closure), so it works over Spark Connect.
Attributes
Persists this Dataset with the default storage level.
Persists this Dataset with the default storage level.
Attributes
Eagerly checkpoints this Dataset to reliable storage and returns the checkpointed copy.
Eagerly checkpoints this Dataset to reliable storage and returns the checkpointed copy.
Attributes
Checkpoints this Dataset to reliable storage.
Checkpoints this Dataset to reliable storage.
Attributes
Selects a column by name, qualified by this Dataset's plan id so that it resolves unambiguously even in self-joins.
Selects a column by name, qualified by this Dataset's plan id so that it resolves unambiguously even in self-joins.
Attributes
Selects columns based on a column name regular expression.
Selects columns based on a column name regular expression.
Attributes
Computes basic statistics (count, mean, stddev, min, max) for numeric and string columns.
Computes basic statistics (count, mean, stddev, min, max) for numeric and string columns.
Attributes
Drops duplicates within the event-time watermark, keeping state bounded for streaming.
Drops duplicates within the event-time watermark, keeping state bounded for streaming.
Attributes
Creates a multi-dimensional aggregation over the given grouping sets, e.g. ds.groupingSets(Seq(Seq($"dept", $"gender"), Seq()), $"dept", $"gender").agg(...).
Creates a multi-dimensional aggregation over the given grouping sets, e.g. ds.groupingSets(Seq(Seq($"dept", $"gender"), Seq()), $"dept", $"gender").agg(...).
Attributes
Joins with other (an inner join), returning each matching pair of records as a tuple. Like Apache Spark, a struct-typed (case class) side becomes a nested struct column.
Joins with other (an inner join), returning each matching pair of records as a tuple. Like Apache Spark, a struct-typed (case class) side becomes a nested struct column.
Attributes
Joins with other using the given join type (inner, cross, outer/full, left or right variants), returning each matching pair of records as a tuple.
Joins with other using the given join type (inner, cross, outer/full, left or right variants), returning each matching pair of records as a tuple.
Attributes
Lateral join with a correlated right relation.
Lateral join with a correlated right relation.
Attributes
Eagerly locally checkpoints this Dataset.
Eagerly locally checkpoints this Dataset.
Attributes
Locally checkpoints this Dataset.
Locally checkpoints this Dataset.
Attributes
Locally checkpoints this Dataset, caching it at the given storage level.
Locally checkpoints this Dataset, caching it at the given storage level.
Attributes
Merges this Dataset (the source) into the table (the target) using condition to match rows. Returns a MergeIntoWriter to configure the WHEN clauses; call merge() to run it.
Merges this Dataset (the source) into the table (the target) using condition to match rows. Returns a MergeIntoWriter to configure the WHEN clauses; call merge() to run it.
Attributes
Selects a metadata column (such as _metadata of file sources) by name, qualified by this Dataset's plan id.
Selects a metadata column (such as _metadata of file sources) by name, qualified by this Dataset's plan id.
Attributes
Returns a DataFrameNaFunctions for working with missing data.
Nearest-by top-K ranking join with the default inner join type: for each row of this Dataset, returns up to numResults rows of right ranked by rankingExpression. mode is approx or exact; direction is distance (smallest first) or similarity (largest first). Requires Spark 4.2+.
Nearest-by top-K ranking join with the default inner join type: for each row of this Dataset, returns up to numResults rows of right ranked by rankingExpression. mode is approx or exact; direction is distance (smallest first) or similarity (largest first). Requires Spark 4.2+.
Attributes
Nearest-by top-K ranking join; joinType is inner or leftouter. The arguments are validated client-side with the same NEAREST_BY_JOIN.* errors as the server. Requires Spark 4.2+.
Nearest-by top-K ranking join; joinType is inner or leftouter. The arguments are validated client-side with the same NEAREST_BY_JOIN.* errors as the server. Requires Spark 4.2+.
Attributes
Defines named observed metrics computed while this Dataset is processed. The metrics are reported with the query result; use the Observation overload to read them back.
Defines named observed metrics computed while this Dataset is processed. The metrics are reported with the query result; use the Observation overload to read them back.
Attributes
Defines observed metrics whose values can be read back through observation.get.
Defines observed metrics whose values can be read back through observation.get.
Attributes
Persists this Dataset with the default storage level (MEMORY_AND_DISK).
Persists this Dataset with the default storage level (MEMORY_AND_DISK).
Attributes
Persists this Dataset with the given storage level.
Persists this Dataset with the given storage level.
Attributes
The full protobuf proto.Plan (a root plan wrapping relation) that would be sent to the server to execute this Dataset. Exposed for plugin authors and tooling; ordinary code never needs it.
The full protobuf proto.Plan (a root plan wrapping relation) that would be sent to the server to execute this Dataset. Exposed for plugin authors and tooling; ordinary code never needs it.
Attributes
Randomly splits this Dataset with the given weights and a fixed seed.
Randomly splits this Dataset with the given weights and a fixed seed.
Attributes
Randomly splits this Dataset with the given weights.
Randomly splits this Dataset with the given weights.
Attributes
(Java-specific) Randomly splits this Dataset with the given weights and seed.
(Java-specific) Randomly splits this Dataset with the given weights and seed.
Attributes
Repartitions into numPartitions partitions, placing each row in the partition whose id is given by partitionIdExpr (evaluated per row), without hashing.
Repartitions into numPartitions partitions, placing each row in the partition whose id is given by partitionIdExpr (evaluated per row), without hashing.
Attributes
Range-partitions by the given expressions into numPartitions.
Range-partitions by the given expressions into numPartitions.
Attributes
Range-partitions by the given expressions.
Range-partitions by the given expressions.
Attributes
Returns a Column for this single-column, single-row Dataset as a scalar subquery, e.g. df.where(col("v") > spark.table("t").select(max("v")).scalar()).
Returns a Column for this single-column, single-row Dataset as a scalar subquery, e.g. df.where(col("v") > spark.table("t").select(max("v")).scalar()).
Attributes
The schema of this Dataset.
The schema of this Dataset.
Attributes
Selects one typed column, returning a Dataset of its values.
Selects one typed column, returning a Dataset of its values.
Attributes
Selects two typed columns, returning a Dataset of tuples.
Selects two typed columns, returning a Dataset of tuples.
Attributes
Selects three typed columns, returning a Dataset of tuples.
Selects three typed columns, returning a Dataset of tuples.
Attributes
Selects four typed columns, returning a Dataset of tuples.
Selects four typed columns, returning a Dataset of tuples.
Attributes
Selects five typed columns, returning a Dataset of tuples.
Selects five typed columns, returning a Dataset of tuples.
Attributes
Returns a DataFrameStatFunctions for statistic functions.
Returns the current storage level of this Dataset.
Returns the current storage level of this Dataset.
Attributes
Computes the requested summary statistics; defaults match Spark's summary().
Computes the requested summary statistics; defaults match Spark's summary().
Attributes
Returns the last n rows. Like collect(), this moves the data into the client.
Returns the last n rows. Like collect(), this moves the data into the client.
Attributes
Returns a new Dataset where each row is reconciled to match the specified schema (by column name, reordering and casting as needed).
Returns a new Dataset where each row is reconciled to match the specified schema (by column name, reordering and casting as needed).
Attributes
Returns the content as a Dataset[String] of JSON documents in a value column.
Returns the content as a Dataset[String] of JSON documents in a value column.
Attributes
Concisely applies a transformation to this Dataset.
Concisely applies a transformation to this Dataset.
Attributes
Transposes the DataFrame, turning the first column into the new column names.
Transposes the DataFrame, turning the first column into the new column names.
Attributes
Transposes the DataFrame using indexColumn for the new column names.
Transposes the DataFrame using indexColumn for the new column names.
Attributes
Marks this Dataset as non-persistent.
Marks this Dataset as non-persistent.
Attributes
Marks this Dataset as non-persistent.
Marks this Dataset as non-persistent.
Attributes
Unpivots (melts) a DataFrame from wide to long format.
Unpivots (melts) a DataFrame from wide to long format.
Attributes
Unpivots, inferring the value columns from those not in ids.
Unpivots, inferring the value columns from those not in ids.
Attributes
Adds or replaces several columns at once.
Adds or replaces several columns at once.
Attributes
(Java-specific) Adds or replaces several columns at once.
(Java-specific) Adds or replaces several columns at once.
Attributes
(Java-specific) Renames several columns at once.
(Java-specific) Renames several columns at once.
Attributes
Returns a new Dataset where the metadata of column columnName is replaced by metadata.
Returns a new Dataset where the metadata of column columnName is replaced by metadata.
Attributes
Defines an event-time watermark for this streaming Dataset.
Defines an event-time watermark for this streaming Dataset.
Attributes
Interface for saving the content of this Dataset to external storage.
Interface for saving the content of this Dataset to external storage.
Attributes
Interface for saving the content of a streaming Dataset to external storage.
Interface for saving the content of a streaming Dataset to external storage.
Attributes
Creates a v2 (catalog) write configuration builder.
Creates a v2 (catalog) write configuration builder.
Attributes
Combines the columns of this DataFrame with other side by side, preserving row alignment. Both must derive from the same source through projection-only operations (select, withColumn, ...); otherwise the server raises an AnalysisException. Requires Spark 4.3+.
Combines the columns of this DataFrame with other side by side, preserving row alignment. Both must derive from the same source through projection-only operations (select, withColumn, ...); otherwise the server raises an AnalysisException. Requires Spark 4.3+.
Attributes
Appends a column of consecutive 0-based Long indices named index, similar to RDD.zipWithIndex(). The index column is the last column of the result.
Appends a column of consecutive 0-based Long indices named index, similar to RDD.zipWithIndex(). The index column is the last column of the result.
Attributes
Appends a column of consecutive 0-based Long indices named indexColName, similar to RDD.zipWithIndex(). If a column with that name already exists, the result has duplicate column names.
Appends a column of consecutive 0-based Long indices named indexColName, similar to RDD.zipWithIndex(). If a column with that name already exists, the result has duplicate column names.
Attributes
Deprecated methods
Registers this Dataset as a temporary view. Use createOrReplaceTempView instead.
Registers this Dataset as a temporary view. Use createOrReplaceTempView instead.
Attributes
- Deprecated
- true