Module spark_connect_rs::column
source · Expand description
A column in a DataFrame
§Examples
A column instance can be created by
use spark_connect_rs::{SparkSession, SparkSessionBuilder};
let spark: SparkSession = SparkSessionBuilder::remote("sc://127.0.0.1:15002/;user_id=example_rs".to_string())
.build()
.await?;
// As a &str representing an unresolved column in the dataframe
spark.range(None, 1, 1, Some(1)).select("id");
// By using the `col` function
spark.range(None, 1, 1, Some(1)).select(col("id"));
// By using the `lit` function to return a literal value
spark.range(None, 1, 1, Some(1)).select(lit(4.0).alias("num_col"));
Structs§
- A Column is composed of a
expressionswhich is used as input into a Plan object