Skip to content

Commit

Permalink
feat(functions): implement more functions #75
Browse files Browse the repository at this point in the history
feat(functions): implement more functions

  - implement nearly all of the remaining functions
  - create a macro to quickly create simple functions
  - create a macro to quickly create simple unit tests
  - fix some doc references
  • Loading branch information
sjrusso8 authored Oct 14, 2024
1 parent 84f170a commit 1a58cd2
Show file tree
Hide file tree
Showing 3 changed files with 1,254 additions and 736 deletions.
6 changes: 3 additions & 3 deletions core/src/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl Column {
///
/// # Arguments:
///
/// * `to_type` is a string or [DataType] of the target type
/// * `to_type` is a string or [crate::types::DataType] of the target type
///
/// # Example:
/// ```rust
Expand Down Expand Up @@ -239,11 +239,11 @@ impl Column {
///
/// # Arguments:
///
/// * `cols` a value that implements the [ToLiteralExpr] trait
/// * `cols` a vector of Columns
///
/// # Example:
/// ```rust
/// df.filter(col("name").isin(["Jorge", "Bob"]));
/// df.filter(col("name").isin([lit("Jorge"), lit("Bob")]));
/// ```
pub fn isin(self, cols: Vec<Column>) -> Column {
let mut val = cols.clone();
Expand Down
9 changes: 0 additions & 9 deletions core/src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
//! Spark Connect has a few different ways of creating expressions and different gRPC methods
//! require expressions in different forms. These traits are used to either translate a value into
//! a [spark::Expression] or into a [spark::expression::Literal].
//!
//! ## Overview
//!
//! - [ToExpr] accepts a `&str`, `String`, or [Column]. This trait uses the method `from` on the Column to create an expression.
//! - [ToLiteral] is used for taking rust types into a [spark::expression::Literal]. These values are then converted into an expression
//! - [ToLiteralExpr`] takes a literal value and converts it into a [spark::Expression]
//! - [ToVecExpr] many gRPC methods require a `Vec<spark::Expression>` this trait is a shorthand for that transformation
//! - [ToFilterExpr] is specifically used for filter statements
//!

use chrono::NaiveDateTime;

Expand Down
Loading

0 comments on commit 1a58cd2

Please sign in to comment.