MCPcopy Create free account
hub / github.com/apache/datafusion / format_boolean

Method format_boolean

datafusion/spark/src/function/string/format_string.rs:1718–1744  ·  view source on GitHub ↗
(&self, writer: &mut String, value: &Option<bool>)

Source from the content-addressed store, hash-verified

1716 }
1717
1718 fn format_boolean(&self, writer: &mut String, value: &Option<bool>) -> Result<()> {
1719 let value = value.unwrap_or(false);
1720
1721 let formatted = match self.conversion_type {
1722 ConversionType::BooleanUpper => {
1723 if value {
1724 "TRUE"
1725 } else {
1726 "FALSE"
1727 }
1728 }
1729 ConversionType::BooleanLower => {
1730 if value {
1731 "true"
1732 } else {
1733 "false"
1734 }
1735 }
1736 _ => {
1737 return exec_err!(
1738 "Invalid conversion type: {:?} for boolean array",
1739 self.conversion_type
1740 );
1741 }
1742 };
1743 self.format_str(writer, formatted)
1744 }
1745
1746 fn format_float(&self, writer: &mut String, value: f64) -> Result<()> {
1747 self.validate_grouping_separator()?;

Callers 1

formatMethod · 0.80

Calls 1

format_strMethod · 0.80

Tested by

no test coverage detected