xinlifoobar commented on code in PR #11330: URL: https://github.com/apache/datafusion/pull/11330#discussion_r1672258635
########## datafusion/sql/tests/sql_integration.rs: ########## @@ -149,6 +153,68 @@ fn parse_ident_normalization() { } } +#[test] +fn test_parse_options_value_normalization() { + let test_data = [ + ( + "CREATE EXTERNAL TABLE test OPTIONS ('location' 'LoCaTiOn') STORED AS PARQUET LOCATION 'fake_location'", + "CreateExternalTable: Bare { table: \"test\" }", + HashMap::from([("format.location", "LoCaTiOn")]), + false, + ), + ( + "CREATE EXTERNAL TABLE test OPTIONS ('location' 'LoCaTiOn') STORED AS PARQUET LOCATION 'fake_location'", + "CreateExternalTable: Bare { table: \"test\" }", Review Comment: The display trait is not implemented for CreateExternalTable, maybe there could be a follow-up task. ########## datafusion/sql/src/statement.rs: ########## @@ -1006,29 +965,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { let inline_constraints = calc_inline_constraints_from_columns(&columns); all_constraints.extend(inline_constraints); - let mut options_map = HashMap::<String, String>::new(); - for (key, value) in options { - if options_map.contains_key(&key) { Review Comment: This check is only enabled for `CreateExternalTable` but not `CopyTo`. ########## datafusion/sql/src/statement.rs: ########## @@ -1187,11 +1151,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { // parse value string from Expr let value_string = match &value[0] { SQLExpr::Identifier(i) => ident_to_string(i), - SQLExpr::Value(v) => match value_to_string(v) { - None => { + SQLExpr::Value(v) => match crate::utils::value_to_string(v) { Review Comment: Here the value is not normalized at all. -- 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