findepi commented on code in PR #14844: URL: https://github.com/apache/datafusion/pull/14844#discussion_r1971099360
########## datafusion-cli/tests/cli_integration.rs: ########## @@ -39,6 +39,10 @@ fn init() { ["--command", "select 1; select 2;", "--format", "json", "-q"], "[{\"Int64(1)\":1}]\n[{\"Int64(2)\":2}]\n" )] +#[case::exec_backslash( + ["--file", "tests/data/backslash.txt", "--format", "json", "-q"], + "[{\"Utf8(\\\"\\\\\\\")\":\"\\\\\",\"Utf8(\\\"\\\\\\\\\\\")\":\"\\\\\\\\\",\"Utf8(\\\"\\\\\\\\\\\\\\\\\\\\\\\")\":\"\\\\\\\\\\\\\\\\\\\\\",\"Utf8(\\\"dsdsds\\\\\\\\\\\\\\\\\\\")\":\"dsdsds\\\\\\\\\\\\\\\\\",\"Utf8(\\\"\\\\t\\\")\":\"\\\\t\",\"Utf8(\\\"\\\\0\\\")\":\"\\\\0\",\"Utf8(\\\"\\\\n\\\")\":\"\\\\n\"}]\n" +)] Review Comment: That's so many backslashes on a single line. What does it test? How do we know it's really correct? (when i test's semantics is debatable, it's prone to change later; it's better to have a test that "is obviously correct") ########## datafusion-cli/src/helper.rs: ########## @@ -166,40 +154,8 @@ impl Validator for CliHelper { impl Helper for CliHelper {} -/// Unescape input string from readline. -/// -/// The data read from stdio will be escaped, so we need to unescape the input before executing the input -pub fn unescape_input(input: &str) -> datafusion::error::Result<String> { Review Comment: So this function was the source of the bug. Per the comment above, someone had a reason to write it though. Do you maybe know what changed? Like, did we change how we obtain input lines? ########## datafusion-cli/src/helper.rs: ########## @@ -310,14 +266,13 @@ mod tests { )?; assert!(matches!(result, ValidationResult::Valid(None))); - // should be invalid let result = readline_direct( - Cursor::new( - r"create external table test stored as csv location 'data.csv' options ('format.delimiter' '\u{07}');" Review Comment: worth keeping this test case? -- 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