Skip to main content

dfq_custom

Function dfq_custom 

Source
pub fn dfq_custom(rule_name: &str, expression: Expr) -> Arc<CustomRule>
Expand description

Creates a rule that applies a custom SQL expression to a column.

§Arguments

  • rule_name - A name for the custom rule
  • expression - The SQL expression to apply

§Examples

use datafusion_quality::rules::column::dfq_custom;
use datafusion_quality::RuleSet;
use datafusion::prelude::*;

// Create a custom rule to check if age is greater than 25
let rule = dfq_custom("age_gt_25", col("age").gt(lit(25)));
let mut ruleset = RuleSet::new();
ruleset.with_column_rule("age", rule);