pub struct DataFrame { /* private fields */ }Expand description
A Spark DataFrame, lazily evaluated.
Mirrors pyspark.sql.DataFrame.
Implementations§
Source§impl DataFrame
impl DataFrame
Sourcepub fn select<C: Into<Column>>(
&self,
columns: impl IntoIterator<Item = C>,
) -> DataFrame
pub fn select<C: Into<Column>>( &self, columns: impl IntoIterator<Item = C>, ) -> DataFrame
Select specific columns.
Sourcepub fn with_column(&self, name: &str, col: Column) -> DataFrame
pub fn with_column(&self, name: &str, col: Column) -> DataFrame
Add or replace a column.
Sourcepub fn with_columns(&self, columns: Vec<(String, Column)>) -> DataFrame
pub fn with_columns(&self, columns: Vec<(String, Column)>) -> DataFrame
Add or replace multiple columns.
Sourcepub fn with_column_renamed(&self, existing: &str, new: &str) -> DataFrame
pub fn with_column_renamed(&self, existing: &str, new: &str) -> DataFrame
Rename a column.
Sourcepub fn with_columns_renamed(&self, renames: Vec<(String, String)>) -> DataFrame
pub fn with_columns_renamed(&self, renames: Vec<(String, String)>) -> DataFrame
Rename multiple columns.
Sourcepub fn drop_duplicates(&self, column_names: Option<Vec<&str>>) -> DataFrame
pub fn drop_duplicates(&self, column_names: Option<Vec<&str>>) -> DataFrame
Remove duplicate rows, optionally on specific columns.
Sourcepub fn sort(&self, columns: Vec<Expression>) -> DataFrame
pub fn sort(&self, columns: Vec<Expression>) -> DataFrame
Sort rows.
Sourcepub fn order_by(&self, columns: Vec<Expression>) -> DataFrame
pub fn order_by(&self, columns: Vec<Expression>) -> DataFrame
Alias for sort().
Sourcepub fn join(
&self,
right: &DataFrame,
on: Option<Column>,
join_type: JoinType,
) -> DataFrame
pub fn join( &self, right: &DataFrame, on: Option<Column>, join_type: JoinType, ) -> DataFrame
Join with another DataFrame.
Sourcepub fn join_using<S: Into<String>>(
&self,
right: &DataFrame,
using_columns: impl IntoIterator<Item = S>,
join_type: JoinType,
) -> DataFrame
pub fn join_using<S: Into<String>>( &self, right: &DataFrame, using_columns: impl IntoIterator<Item = S>, join_type: JoinType, ) -> DataFrame
Join with another DataFrame using column names (a name-based/“using” join).
Sourcepub fn nearest_by_join(
&self,
other: &DataFrame,
ranking_expression: Column,
num_results: i32,
mode: &str,
direction: &str,
join_type: &str,
) -> DataFrame
pub fn nearest_by_join( &self, other: &DataFrame, ranking_expression: Column, num_results: i32, mode: &str, direction: &str, join_type: &str, ) -> DataFrame
Nearest-by join: for each left row, the num_results nearest right rows
ranked by ranking_expression. Mirrors DataFrame.nearestByJoin.
mode ∈ {“approx”,“exact”}, direction ∈ {“distance”,“similarity”},
join_type ∈ {“inner”,“leftouter”}.
Sourcepub fn cross_join(&self, right: &DataFrame) -> DataFrame
pub fn cross_join(&self, right: &DataFrame) -> DataFrame
Cross join.
Sourcepub fn lateral_join(
&self,
right: &DataFrame,
on: Option<Column>,
join_type: JoinType,
) -> DataFrame
pub fn lateral_join( &self, right: &DataFrame, on: Option<Column>, join_type: JoinType, ) -> DataFrame
Lateral join with another DataFrame (a LATERAL correlated subquery join).
Mirrors pyspark.sql.DataFrame.lateralJoin.
Sourcepub fn union_by_name(&self, other: &DataFrame) -> DataFrame
pub fn union_by_name(&self, other: &DataFrame) -> DataFrame
Union by name.
Sourcepub fn union_by_name_opt(
&self,
other: &DataFrame,
allow_missing_columns: bool,
) -> DataFrame
pub fn union_by_name_opt( &self, other: &DataFrame, allow_missing_columns: bool, ) -> DataFrame
unionByName with the allowMissingColumns option (columns present in only
one side are filled with null rather than rejected). Mirrors
DataFrame.unionByName(other, allowMissingColumns=False).
Sourcepub fn repartition(&self, num_partitions: i32) -> DataFrame
pub fn repartition(&self, num_partitions: i32) -> DataFrame
Repartition.
Sourcepub fn hint<S: Into<String>>(
&self,
name: &str,
parameters: impl IntoIterator<Item = S>,
) -> DataFrame
pub fn hint<S: Into<String>>( &self, name: &str, parameters: impl IntoIterator<Item = S>, ) -> DataFrame
Add a hint.
Sourcepub fn broadcast(&self) -> DataFrame
pub fn broadcast(&self) -> DataFrame
Marks a DataFrame as eligible for broadcast join (smaller table).
Mirrors pyspark.sql.functions.broadcast.
Sourcepub fn to_df(&self, column_names: Vec<&str>) -> DataFrame
pub fn to_df(&self, column_names: Vec<&str>) -> DataFrame
Convert to DataFrame with new column names.
Sourcepub fn map_in_pandas(
&self,
func: CommonInlineUserDefinedFunctionExpression,
is_barrier: bool,
) -> DataFrame
pub fn map_in_pandas( &self, func: CommonInlineUserDefinedFunctionExpression, is_barrier: bool, ) -> DataFrame
Map over each partition with a pandas UDF (DataFrame.mapInPandas).
The func (built by the Python side, cloudpickled with eval type
SQL_MAP_PANDAS_ITER_UDF) is applied to iterators of pandas DataFrames.
Sourcepub fn map_in_arrow(
&self,
func: CommonInlineUserDefinedFunctionExpression,
is_barrier: bool,
) -> DataFrame
pub fn map_in_arrow( &self, func: CommonInlineUserDefinedFunctionExpression, is_barrier: bool, ) -> DataFrame
Map over each partition with an Arrow UDF (DataFrame.mapInArrow).
Sourcepub fn foreach(
&self,
func: CommonInlineUserDefinedFunctionExpression,
) -> Result<()>
pub fn foreach( &self, func: CommonInlineUserDefinedFunctionExpression, ) -> Result<()>
Apply a function to each row for its side effects (DataFrame.foreach).
Backed by an Arrow map partition; results are forced and discarded.
Sourcepub fn foreach_partition(
&self,
func: CommonInlineUserDefinedFunctionExpression,
) -> Result<()>
pub fn foreach_partition( &self, func: CommonInlineUserDefinedFunctionExpression, ) -> Result<()>
Apply a function to each partition for its side effects
(DataFrame.foreachPartition).
Sourcepub fn sample_opt(
&self,
fraction: f64,
with_replacement: bool,
seed: Option<i64>,
) -> DataFrame
pub fn sample_opt( &self, fraction: f64, with_replacement: bool, seed: Option<i64>, ) -> DataFrame
sample with the withReplacement option. Mirrors
DataFrame.sample(withReplacement, fraction, seed).
Sourcepub fn group_by<C: Into<Column>>(
&self,
group_cols: impl IntoIterator<Item = C>,
) -> GroupedData
pub fn group_by<C: Into<Column>>( &self, group_cols: impl IntoIterator<Item = C>, ) -> GroupedData
Group by columns for aggregation.
Sourcepub fn to_local_iterator(
&self,
prefetch_partitions: bool,
) -> Result<LocalRowIterator>
pub fn to_local_iterator( &self, prefetch_partitions: bool, ) -> Result<LocalRowIterator>
Return an iterator that lazily streams rows from the server.
Mirrors pyspark.sql.DataFrame.toLocalIterator(prefetchPartitions=False).
Unlike collect(), which buffers all results in memory, this returns an iterator
that yields Row objects as the server streams them, consuming minimal memory.
§Arguments
prefetch_partitions- If true, a background task fetches the next batch from the server while the caller consumes the current one (one batch buffered ahead), overlapping network I/O with row processing. If false, each batch is fetched on demand only once the previous batch is exhausted.
Sourcepub fn execution_info(&self) -> Result<ExecutionInfo>
pub fn execution_info(&self) -> Result<ExecutionInfo>
Execution metrics collected during the most recent action on this
DataFrame’s session. Mirrors pyspark.sql.DataFrame.executionInfo.
The metrics reflect the session’s most recent execution; call this right
after an action (e.g. collect/count/show).
Sourcepub fn collect_record_batches(&self) -> Result<Vec<RecordBatch>>
pub fn collect_record_batches(&self) -> Result<Vec<RecordBatch>>
Collect all data as Arrow RecordBatches.
Streams execution results from the server and decodes Arrow IPC batches,
returning the raw RecordBatches without converting to Rows. This is the
foundation for to_datafusion() and to_polars() conversions.
Sourcepub fn count(&self) -> Result<i64>
pub fn count(&self) -> Result<i64>
Get the count of rows.
Mirrors pyspark.sql.DataFrame.count() = groupBy().count().collect()[0][0]:
a global count aggregate is pushed to the server, which returns a single row,
rather than streaming every row back to the client just to count them.
Sourcepub fn write(&self) -> DataFrameWriter
pub fn write(&self) -> DataFrameWriter
Create a DataFrameWriter for writing this DataFrame to various destinations.
Mirrors pyspark.sql.DataFrame.write.
Sourcepub fn write_to(&self, table_name: &str) -> DataFrameWriterV2
pub fn write_to(&self, table_name: &str) -> DataFrameWriterV2
Create a DataFrameWriterV2 for
the v2 write API.
Mirrors pyspark.sql.DataFrame.writeTo.
Sourcepub fn merge_into(&self, table: &str, condition: Column) -> MergeIntoWriter
pub fn merge_into(&self, table: &str, condition: Column) -> MergeIntoWriter
Merge a set of updates, insertions, and deletions into a target table.
Mirrors pyspark.sql.DataFrame.mergeInto: returns a crate::merge::MergeIntoWriter
on which when_matched / when_not_matched / when_not_matched_by_source clauses
are added before calling merge().
Sourcepub fn write_stream(&self) -> DataStreamWriter
pub fn write_stream(&self) -> DataStreamWriter
Create a DataStreamWriter for writing this streaming DataFrame to various sinks.
Mirrors pyspark.sql.DataFrame.writeStream.
Sourcepub fn cache(&self) -> Result<DataFrame>
pub fn cache(&self) -> Result<DataFrame>
Cache this DataFrame with the default MEMORY_AND_DISK_DESER storage level.
Mirrors pyspark.sql.DataFrame.cache().
Sourcepub fn persist(&self, storage_level: StorageLevel) -> Result<DataFrame>
pub fn persist(&self, storage_level: StorageLevel) -> Result<DataFrame>
Persist this DataFrame with the given storage level.
Mirrors pyspark.sql.DataFrame.persist(storageLevel).
Sourcepub fn unpersist(&self, blocking: bool) -> Result<DataFrame>
pub fn unpersist(&self, blocking: bool) -> Result<DataFrame>
Remove this DataFrame from cache. Mirrors DataFrame.unpersist(blocking).
Sourcepub fn checkpoint(&self) -> Result<DataFrame>
pub fn checkpoint(&self) -> Result<DataFrame>
Checkpoint this DataFrame to disk.
Sourcepub fn local_checkpoint(&self) -> Result<DataFrame>
pub fn local_checkpoint(&self) -> Result<DataFrame>
Create a local checkpoint of this DataFrame.
Sourcepub fn create_temp_view(&self, name: &str) -> Result<()>
pub fn create_temp_view(&self, name: &str) -> Result<()>
Create a temporary view for this DataFrame.
Sourcepub fn create_or_replace_temp_view(&self, name: &str) -> Result<()>
pub fn create_or_replace_temp_view(&self, name: &str) -> Result<()>
Create or replace a temporary view for this DataFrame.
Sourcepub fn create_global_temp_view(&self, name: &str) -> Result<()>
pub fn create_global_temp_view(&self, name: &str) -> Result<()>
Create a global temporary view for this DataFrame.
Sourcepub fn create_or_replace_global_temp_view(&self, name: &str) -> Result<()>
pub fn create_or_replace_global_temp_view(&self, name: &str) -> Result<()>
Create or replace a global temporary view for this DataFrame.
Sourcepub fn explain(&self) -> Result<()>
pub fn explain(&self) -> Result<()>
Print the execution plan to the console. Mirrors pyspark.sql.DataFrame.explain
(was previously a no-op that ran the query relation instead of an AnalyzePlan).
Sourcepub fn explain_mode(&self, mode: &str) -> Result<()>
pub fn explain_mode(&self, mode: &str) -> Result<()>
Print the execution plan in a specific mode. Mirrors the mode argument of
pyspark.sql.DataFrame.explain: one of “simple”, “extended”, “codegen”,
“cost”, “formatted” (case-insensitive).
Sourcepub fn with_watermark(
&self,
time_column: &str,
delay_threshold: &str,
) -> DataFrame
pub fn with_watermark( &self, time_column: &str, delay_threshold: &str, ) -> DataFrame
Add a watermark to this DataFrame for event-time based windows.
Sourcepub fn repartition_by_range(
&self,
num_partitions: i32,
columns: Vec<Expression>,
) -> DataFrame
pub fn repartition_by_range( &self, num_partitions: i32, columns: Vec<Expression>, ) -> DataFrame
Repartition this DataFrame by range.
Sourcepub fn repartition_by_expressions(
&self,
num_partitions: i32,
columns: Vec<Expression>,
) -> DataFrame
pub fn repartition_by_expressions( &self, num_partitions: i32, columns: Vec<Expression>, ) -> DataFrame
Repartition into num_partitions by hashing the given column expressions.
Mirrors df.repartition(numPartitions, *cols).
Sourcepub fn melt(
&self,
id_vars: Vec<&str>,
value_vars: Option<Vec<&str>>,
var_name: &str,
value_name: &str,
) -> DataFrame
pub fn melt( &self, id_vars: Vec<&str>, value_vars: Option<Vec<&str>>, var_name: &str, value_name: &str, ) -> DataFrame
Melt (unpivot) this DataFrame.
Sourcepub fn input_files(&self) -> Result<Vec<String>>
pub fn input_files(&self) -> Result<Vec<String>>
Get the input files for this DataFrame. Mirrors pyspark.sql.DataFrame.inputFiles.
Sourcepub fn observe(&self, name: &str, exprs: Vec<Expression>) -> DataFrame
pub fn observe(&self, name: &str, exprs: Vec<Expression>) -> DataFrame
Observe metrics on this DataFrame.
Sourcepub fn stat(&self) -> StatFunctions
pub fn stat(&self) -> StatFunctions
Get stat functions.
Sourcepub fn na(&self) -> NaFunctions
pub fn na(&self) -> NaFunctions
Returns a crate::group::NaFunctions for handling missing values.
Mirrors pyspark.sql.DataFrame.na.
Sourcepub fn agg(&self, expressions: Vec<Expression>) -> DataFrame
pub fn agg(&self, expressions: Vec<Expression>) -> DataFrame
Perform aggregation without grouping.
Sourcepub fn select_expr(&self, exprs: Vec<&str>) -> DataFrame
pub fn select_expr(&self, exprs: Vec<&str>) -> DataFrame
Select with SQL expressions, mirroring DataFrame.selectExpr.
Each string is parsed as a SQL expression (e.g. "id + 1 AS x"), not treated
as a bare column name - so it must go through functions::expr (an
ExpressionString the server parses), not col (an unresolved attribute,
which made selectExpr("id + 1 AS x") fail to resolve).
Sourcepub fn fillna(&self, value: i64, subset: Option<Vec<&str>>) -> DataFrame
pub fn fillna(&self, value: i64, subset: Option<Vec<&str>>) -> DataFrame
Fill NA values with an integer.
Sourcepub fn fillna_double(&self, value: f64, subset: Option<Vec<&str>>) -> DataFrame
pub fn fillna_double(&self, value: f64, subset: Option<Vec<&str>>) -> DataFrame
Fill NA values with a double (e.g. a fractional fill into a double column).
Sourcepub fn fillna_string(&self, value: &str, subset: Option<Vec<&str>>) -> DataFrame
pub fn fillna_string(&self, value: &str, subset: Option<Vec<&str>>) -> DataFrame
Fill NA values with a string.
Sourcepub fn fillna_bool(&self, value: bool, subset: Option<Vec<&str>>) -> DataFrame
pub fn fillna_bool(&self, value: bool, subset: Option<Vec<&str>>) -> DataFrame
Fill NA values with a boolean.
Sourcepub fn fillna_value(&self, value: Value, subset: Option<Vec<&str>>) -> DataFrame
pub fn fillna_value(&self, value: Value, subset: Option<Vec<&str>>) -> DataFrame
Fill NA values with a typed crate::row::Value (Long/Double/String/Bool/…).
Sourcepub fn fillna_map(&self, pairs: Vec<(String, Value)>) -> DataFrame
pub fn fillna_map(&self, pairs: Vec<(String, Value)>) -> DataFrame
Fill NA values per column from (column, value) pairs.
Mirrors df.fillna({col: value, ...}).
Sourcepub fn dropna(
&self,
how: Option<&str>,
thresh: Option<i32>,
subset: Option<Vec<&str>>,
) -> DataFrame
pub fn dropna( &self, how: Option<&str>, thresh: Option<i32>, subset: Option<Vec<&str>>, ) -> DataFrame
Drop NA values.
Sourcepub fn replace(
&self,
to_replace: Vec<(String, String)>,
subset: Option<Vec<&str>>,
) -> DataFrame
pub fn replace( &self, to_replace: Vec<(String, String)>, subset: Option<Vec<&str>>, ) -> DataFrame
Replace values.
Sourcepub fn describe(&self, columns: Vec<&str>) -> DataFrame
pub fn describe(&self, columns: Vec<&str>) -> DataFrame
Describe this DataFrame (show statistics).
Sourcepub fn metadata_column(&self, name: &str) -> Column
pub fn metadata_column(&self, name: &str) -> Column
Select a metadata column by name. Mirrors pyspark.sql.DataFrame.metadataColumn.
Sourcepub fn rollup<C: Into<Column>>(
&self,
group_cols: impl IntoIterator<Item = C>,
) -> GroupedData
pub fn rollup<C: Into<Column>>( &self, group_cols: impl IntoIterator<Item = C>, ) -> GroupedData
Group by with rollup.
Sourcepub fn cube<C: Into<Column>>(
&self,
group_cols: impl IntoIterator<Item = C>,
) -> GroupedData
pub fn cube<C: Into<Column>>( &self, group_cols: impl IntoIterator<Item = C>, ) -> GroupedData
Group by with cube.
Sourcepub fn grouping_sets(&self, group_cols: Vec<Vec<Column>>) -> GroupedData
pub fn grouping_sets(&self, group_cols: Vec<Vec<Column>>) -> GroupedData
Group by with grouping sets. Each inner Vec<Column> is one grouping set;
the sets are preserved on the wire (GROUP_TYPE_GROUPING_SETS + the
grouping_sets field) rather than flattened into a single group-by.
Sourcepub fn sort_within_partitions(&self, columns: Vec<Expression>) -> DataFrame
pub fn sort_within_partitions(&self, columns: Vec<Expression>) -> DataFrame
Sort within partitions (local sort).
Sourcepub fn drop_duplicates_within_watermark(
&self,
column_names: Option<Vec<&str>>,
) -> DataFrame
pub fn drop_duplicates_within_watermark( &self, column_names: Option<Vec<&str>>, ) -> DataFrame
Drop duplicates within a watermark.
Sourcepub fn transform<F>(&self, f: F) -> DataFrame
pub fn transform<F>(&self, f: F) -> DataFrame
Apply a transformation function to this DataFrame.
Sourcepub fn random_split(
&self,
weights: Vec<f64>,
seed: Option<i64>,
) -> Vec<DataFrame>
pub fn random_split( &self, weights: Vec<f64>, seed: Option<i64>, ) -> Vec<DataFrame>
Randomly split this DataFrame into multiple parts.
Sourcepub fn print_schema(&self) -> Result<()>
pub fn print_schema(&self) -> Result<()>
Print the schema of this DataFrame.
Sourcepub fn storage_level(&self) -> Result<StorageLevel>
pub fn storage_level(&self) -> Result<StorageLevel>
Get the storage level of this DataFrame. Mirrors DataFrame.storageLevel.
Sourcepub fn is_cached(&self) -> Result<bool>
pub fn is_cached(&self) -> Result<bool>
Check if this DataFrame is cached. Mirrors DataFrame.is_cached.
Derived from the server-reported storage level (cached iff it uses memory or disk), rather than inspecting the local plan.
Sourcepub fn semantic_hash(&self) -> Result<i32>
pub fn semantic_hash(&self) -> Result<i32>
Compute the server-side semantic hash of this DataFrame’s logical plan,
mirroring DataFrame.semanticHash() (an AnalyzePlan request).
Sourcepub fn same_semantics(&self, other: &DataFrame) -> Result<bool>
pub fn same_semantics(&self, other: &DataFrame) -> Result<bool>
Whether two DataFrames have the same semantics, mirroring
DataFrame.sameSemantics(other) (a server-side AnalyzePlan comparison).
Sourcepub fn to_json(&self) -> Result<Vec<String>>
pub fn to_json(&self) -> Result<Vec<String>>
Convert each row to a JSON object string, mirroring DataFrame.toJSON().
Reference pyspark produces {"col":val,...} per row by applying the server’s
to_json(struct(*)), not a client-side row rendering (which previously emitted
Rust list syntax like [1, a]). Build that projection and collect the strings.
Sourcepub fn union_all(&self, other: &DataFrame) -> DataFrame
pub fn union_all(&self, other: &DataFrame) -> DataFrame
Union all rows (alias for union with all=true).
Sourcepub fn except_all(&self, other: &DataFrame) -> DataFrame
pub fn except_all(&self, other: &DataFrame) -> DataFrame
Except all rows.
Sourcepub fn intersect_all(&self, other: &DataFrame) -> DataFrame
pub fn intersect_all(&self, other: &DataFrame) -> DataFrame
Intersect all rows.
Sourcepub fn unpivot<C: Into<Column>, D: Into<Column>>(
&self,
ids: impl IntoIterator<Item = C>,
values: Option<impl IntoIterator<Item = D>>,
variable_column_name: &str,
value_column_name: &str,
) -> DataFrame
pub fn unpivot<C: Into<Column>, D: Into<Column>>( &self, ids: impl IntoIterator<Item = C>, values: Option<impl IntoIterator<Item = D>>, variable_column_name: &str, value_column_name: &str, ) -> DataFrame
Unpivot columns (like melt).
Sourcepub fn with_metadata(
&self,
column_name: &str,
metadata: HashMap<String, String>,
) -> DataFrame
pub fn with_metadata( &self, column_name: &str, metadata: HashMap<String, String>, ) -> DataFrame
Set metadata on an existing column.
Mirrors pyspark.sql.connect.dataframe.DataFrame.withMetadata: the column is
re-selected with the given metadata attached (serialized to a JSON map).
Sourcepub fn spark_session(&self) -> SparkSession
pub fn spark_session(&self) -> SparkSession
Get the Spark session.
Sourcepub fn is_streaming(&self) -> bool
pub fn is_streaming(&self) -> bool
Check if this DataFrame is streaming.
Sourcepub fn to_arrow(&self) -> Result<Vec<u8>>
pub fn to_arrow(&self) -> Result<Vec<u8>>
Collect the DataFrame and serialize it to Arrow IPC (file format) bytes.
The returned buffer is a self-describing Arrow IPC stream that can be read
back with arrow::ipc::reader::FileReader (or handed to pyarrow, polars,
etc.). An empty result yields a valid IPC file with an empty schema.
Sourcepub fn repartition_by_id(
&self,
num_partitions: i32,
partition_id_col: Column,
) -> DataFrame
pub fn repartition_by_id( &self, num_partitions: i32, partition_id_col: Column, ) -> DataFrame
Repartition into num_partitions using the given column’s value directly as
the shuffle partition id. Mirrors DataFrame.repartitionById(numPartitions, partitionIdCol): the column is wrapped in a DirectShufflePartitionID
expression and used as the sole repartition expression.
Sourcepub fn zip_with_index(&self, index_col_name: &str) -> DataFrame
pub fn zip_with_index(&self, index_col_name: &str) -> DataFrame
Append a monotonically increasing index column. Mirrors
DataFrame.zipWithIndex(indexColName="index"):
self.select(col("*"), distributed_sequence_id().alias(indexColName)).
Sourcepub fn to(&self, schema: DataType) -> DataFrame
pub fn to(&self, schema: DataType) -> DataFrame
Reconcile this DataFrame to a new schema: reorder/select columns by name and cast them to the target types.
Mirrors pyspark.sql.connect.dataframe.DataFrame.to (a ToSchema relation).
Sourcepub fn scalar(&self) -> Result<Option<Value>>
pub fn scalar(&self) -> Result<Option<Value>>
Get a scalar value from a single-row, single-column result.
Sourcepub fn transpose(&self) -> Result<DataFrame>
pub fn transpose(&self) -> Result<DataFrame>
Transpose the DataFrame: swap rows and columns (server-side Transpose
relation). Mirrors pyspark.sql.connect.dataframe.DataFrame.transpose()
with no index column (the server uses the first column as the header).
Sourcepub fn transpose_with_index(&self, index_column: Column) -> Result<DataFrame>
pub fn transpose_with_index(&self, index_column: Column) -> Result<DataFrame>
Transpose using an explicit index column as the transposed header.
Mirrors DataFrame.transpose(indexColumn).
Sourcepub fn zip(&self, other: &DataFrame) -> Result<DataFrame>
pub fn zip(&self, other: &DataFrame) -> Result<DataFrame>
Zip this DataFrame with another DataFrame by row number.
Sourcepub fn register_temp_table(&self, name: &str) -> Result<()>
pub fn register_temp_table(&self, name: &str) -> Result<()>
Register this DataFrame as a temporary table (deprecated - use createTempView).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DataFrame
impl !RefUnwindSafe for DataFrame
impl !UnwindSafe for DataFrame
impl Send for DataFrame
impl Sync for DataFrame
impl Unpin for DataFrame
impl UnsafeUnpin for DataFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request