You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by al...@apache.org on 2025/08/14 10:53:47 UTC

(datafusion) branch main updated: Normalize `NUL` to `\0` in sqllogictests (#17181)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 274cdba753 Normalize `NUL` to `\0` in sqllogictests (#17181)
274cdba753 is described below

commit 274cdba753f9716c67a451c120bcf1032dece222
Author: Jeffrey Vo <je...@gmail.com>
AuthorDate: Thu Aug 14 20:53:42 2025 +1000

    Normalize `NUL` to `\0` in sqllogictests (#17181)
    
    * Normalize `NUL` to `\0` in sqllogictests
    
    * Update datafusion/sqllogictest/src/engines/conversion.rs
    
    Co-authored-by: Andrew Lamb <an...@nerdnetworks.org>
    
    ---------
    
    Co-authored-by: Andrew Lamb <an...@nerdnetworks.org>
---
 datafusion/sqllogictest/src/engines/conversion.rs   |   3 ++-
 datafusion/sqllogictest/test_files/expr.slt         | Bin 34736 -> 34737 bytes
 .../sqllogictest/test_files/spark/string/char.slt   | Bin 969 -> 970 bytes
 3 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/datafusion/sqllogictest/src/engines/conversion.rs b/datafusion/sqllogictest/src/engines/conversion.rs
index 92ab64059b..de3acbee93 100644
--- a/datafusion/sqllogictest/src/engines/conversion.rs
+++ b/datafusion/sqllogictest/src/engines/conversion.rs
@@ -35,7 +35,8 @@ pub(crate) fn varchar_to_str(value: &str) -> String {
     if value.is_empty() {
         "(empty)".to_string()
     } else {
-        value.trim_end_matches('\n').to_string()
+        // Escape nulls so that github renders them correctly in the webui
+        value.trim_end_matches('\n').replace("\u{0000}", "\\0")
     }
 }
 
diff --git a/datafusion/sqllogictest/test_files/expr.slt b/datafusion/sqllogictest/test_files/expr.slt
index f0bf5d76e8..eeea3cd39a 100644
Binary files a/datafusion/sqllogictest/test_files/expr.slt and b/datafusion/sqllogictest/test_files/expr.slt differ
diff --git a/datafusion/sqllogictest/test_files/spark/string/char.slt b/datafusion/sqllogictest/test_files/spark/string/char.slt
index abf0c7076a..299e2a0413 100644
Binary files a/datafusion/sqllogictest/test_files/spark/string/char.slt and b/datafusion/sqllogictest/test_files/spark/string/char.slt differ


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org