bump sqllogictest to 0.9.0#4547
bump sqllogictest to 0.9.0#4547xudong963 merged 5 commits intoapache:masterfrom xxchan:xxchan/naval-donkey
Conversation
| let builder = WriterBuilder::new().has_headers(false).with_delimiter(b' '); | ||
| let builder = WriterBuilder::new() | ||
| .has_headers(false) | ||
| .with_delimiter(b'\t'); | ||
| let mut writer = builder.build(&mut bytes); | ||
| for batch in batches { | ||
| writer.write(&normalize_batch(batch)).unwrap(); | ||
| } | ||
| } | ||
| Ok(String::from_utf8(bytes).unwrap()) | ||
| let res = String::from_utf8(bytes).unwrap(); | ||
| let rows = res | ||
| .lines() | ||
| .map(|s| { | ||
| s.split("\t") | ||
| .map(|s| { | ||
| if s.is_empty() { | ||
| "NULL".to_string() | ||
| } else { | ||
| s.to_string() | ||
| } | ||
| }) | ||
| .collect() | ||
| }) | ||
| .collect(); |
There was a problem hiding this comment.
Using tab-separated CSV to get a row as Vec<String> is a little bit hacky, but it works... 😄
BTW here's some information about separator in test files risinglightdb/sqllogictest-rs#109
There was a problem hiding this comment.
Thank you @xxchan -- this is great! The new interface makes a lot of sense. Thank you for the PR!
Given what I see here, I think there may be some better ways to format the output into Vec<Vec<String>> than re-parsing CSV, by using arrow directly (for example how it is done in https://docs.rs/arrow/28.0.0/arrow/util/pretty/index.html)
I'll give it a think and see if I can find some way to update it
| if batches.is_empty() { | ||
| return Ok(DBOutput::StatementComplete(0)); | ||
| } | ||
| // TODO: use the actual types |
There was a problem hiding this comment.
👍 thanks -- we can fill this in
| let builder = WriterBuilder::new().has_headers(false).with_delimiter(b' '); | ||
| let builder = WriterBuilder::new() | ||
| .has_headers(false) | ||
| .with_delimiter(b'\t'); | ||
| let mut writer = builder.build(&mut bytes); | ||
| for batch in batches { | ||
| writer.write(&normalize_batch(batch)).unwrap(); | ||
| } | ||
| } | ||
| Ok(String::from_utf8(bytes).unwrap()) | ||
| let res = String::from_utf8(bytes).unwrap(); | ||
| let rows = res | ||
| .lines() | ||
| .map(|s| { | ||
| s.split("\t") | ||
| .map(|s| { | ||
| if s.is_empty() { | ||
| "NULL".to_string() | ||
| } else { | ||
| s.to_string() | ||
| } | ||
| }) | ||
| .collect() | ||
| }) | ||
| .collect(); |
There was a problem hiding this comment.
Thank you @xxchan -- this is great! The new interface makes a lot of sense. Thank you for the PR!
Given what I see here, I think there may be some better ways to format the output into Vec<Vec<String>> than re-parsing CSV, by using arrow directly (for example how it is done in https://docs.rs/arrow/28.0.0/arrow/util/pretty/index.html)
I'll give it a think and see if I can find some way to update it
| select 'foo', '', NULL | ||
| ---- | ||
| foo (empty) No newline at end of file | ||
| foo (empty) NULL No newline at end of file |
There was a problem hiding this comment.
@xxchan You are so quickly!
I noticed your new release and prepared to remove the issue about NULL. Then I found you done!
Thank you
| select * from users; | ||
| ---- | ||
| 1 2 | ||
| 11 20 |
There was a problem hiding this comment.
For rowsort, runner will only sort actual results now, which means the result in the test cases should be sorted.
|
FWIW if no one beats me to it I plan to try and polish the conversion to I poked around in the sqllogictest runner, and it looks like you already have some code that will run / update the test files with new results that looks super awesome (and relevant to updating results) |
Yes, it's a cool feature.
Sounds great! |
|
rebased & resolved conflicts. |
|
Hope this is the last fix... |
|
Let's merge! |
|
Thanks @xxchan and @xudong963 |

NULLnormalization, close Implement null / empty string handling for sqllogictest #4500re #4460
cc @alamb @xudong963