Skip to main content

dfq_str_length

Function dfq_str_length 

Source
pub fn dfq_str_length(min: Option<u32>, max: Option<u32>) -> Arc<LengthRule>
Expand description

Creates a rule that checks if the length of a string column is between a minimum and maximum value.

§Arguments

  • min - Optional minimum length (inclusive)
  • max - Optional maximum length (inclusive)

§Examples

use datafusion_quality::rules::column::dfq_str_length;
use datafusion_quality::RuleSet;

// Create a rule to check if name length is between 3 and 10 characters
let rule = dfq_str_length(Some(3), Some(10));
let mut ruleset = RuleSet::new();
ruleset.with_column_rule("name", rule);