Omega359 commented on code in PR #14254: URL: https://github.com/apache/datafusion/pull/14254#discussion_r1928766203
########## datafusion/sqllogictest/bin/sqllogictests.rs: ########## @@ -64,6 +66,171 @@ fn value_normalizer(s: &String) -> String { s.trim_end().to_string() } +struct CustomRunner<D: AsyncDB, M: MakeConnection> { + runner: Runner<D, M>, +} + +impl<D: AsyncDB, M: MakeConnection<Conn = D>> CustomRunner<D, M> { + pub fn new(make_conn: M) -> Self { + CustomRunner { + runner: Runner::new(make_conn), + } + } + + pub async fn update_test_file( + &mut self, + filename: impl AsRef<Path>, + col_separator: &str, + validator: Validator, + normalizer: Normalizer, + column_type_validator: ColumnTypeValidator<D::ColumnType>, + ) -> Result<(), Box<dyn std::error::Error>> { + use std::io::{Read, Seek, SeekFrom, Write}; + use std::path::PathBuf; + + use std::fs::{File, OpenOptions}; + + fn create_outfile( + filename: impl AsRef<Path>, + ) -> std::io::Result<(PathBuf, File)> { + let filename = filename.as_ref(); + // let outfilename = format!( + // "{}.{:016x}.temp", + // filename.file_name().unwrap().to_str().unwrap(), + // Instant::now().as_nanos() + // ); + let outfilename = filename.file_name().unwrap().to_str().unwrap().to_owned() + + &format!("{:?}", Instant::now()) Review Comment: DF has rand as a dependency already, I can't see how adding it would cause any difficulties -- 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