xinlifoobar commented on code in PR #11330: URL: https://github.com/apache/datafusion/pull/11330#discussion_r1681113153
########## datafusion/sql/src/utils.rs: ########## @@ -263,6 +263,34 @@ pub(crate) fn normalize_ident(id: Ident) -> String { } } +pub(crate) fn normalize_value(value: &Value) -> Result<String> { + value_to_string(value).map(|v| v.to_ascii_lowercase()) +} + +pub(crate) fn value_to_string(value: &Value) -> Result<String> { + match value { + Value::SingleQuotedString(s) => Ok(s.to_string()), + Value::DollarQuotedString(s) => Ok(s.to_string()), + Value::Number(_, _) | Value::Boolean(_) => Ok(value.to_string()), + Value::DoubleQuotedString(_) + | Value::EscapedStringLiteral(_) + | Value::NationalStringLiteral(_) + | Value::SingleQuotedByteStringLiteral(_) + | Value::DoubleQuotedByteStringLiteral(_) + | Value::TripleSingleQuotedString(_) + | Value::TripleDoubleQuotedString(_) + | Value::TripleSingleQuotedByteStringLiteral(_) + | Value::TripleDoubleQuotedByteStringLiteral(_) + | Value::SingleQuotedRawStringLiteral(_) + | Value::DoubleQuotedRawStringLiteral(_) + | Value::TripleSingleQuotedRawStringLiteral(_) + | Value::TripleDoubleQuotedRawStringLiteral(_) + | Value::HexStringLiteral(_) + | Value::Null + | Value::Placeholder(_) => plan_err!("Unsupported Value to normalize {}", value), Review Comment: Thanks... I have reverted that change to keep the original behaviour.. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org