-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added "DEFAULT_CLI_FORMAT_OPTIONS" for cli and sqllogic test #14052
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM👍
@@ -195,7 +195,7 @@ SELECT MAP('type', 'test'); | |||
|
|||
SELECT MAP(['POST', 'HEAD', 'PATCH'], [41, 33, null]); | |||
---- | |||
{POST: 41, HEAD: 33, PATCH: } | |||
{POST: 41, HEAD: 33, PATCH: NULL} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is more human-readable to me.
@@ -240,7 +240,8 @@ pub fn cell_to_string(col: &ArrayRef, row: usize) -> Result<String> { | |||
Ok(cell_to_string(dict.values(), key)?) | |||
} | |||
_ => { | |||
let f = ArrayFormatter::try_new(col.as_ref(), &DEFAULT_FORMAT_OPTIONS); | |||
let f = | |||
ArrayFormatter::try_new(col.as_ref(), &DEFAULT_CLI_FORMAT_OPTIONS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change makes it consistent with
datafusion/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs
Lines 198 to 201 in 61afb0d
if !col.is_valid(row) { | |
// represent any null value with the string "NULL" | |
Ok(NULL_STR.to_string()) | |
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Thanks @jatin510 |
Which issue does this PR close?
Closes #13872.
Discussions on PR: #14046
Rationale for this change
The null values are printed blank, now they will be printed as "NULL".
Before:
Now:
What changes are included in this PR?
A
DEFAULT_CLI_FORMAT_OPTIONS
is added for proper formatting in cli for the null valuesAre these changes tested?
Yes, Updated the slt test files.
Are there any user-facing changes?
Yes
Breaking changes in cli