Skip to content

Commit

Permalink
Trim Unnecessary Quote for CLI JSON output (#4643)
Browse files Browse the repository at this point in the history
  • Loading branch information
SterlingT3485 authored Dec 17, 2024
1 parent df1f60b commit 109012e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tools/shell/embedded_shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,16 @@ std::string EmbeddedShell::printJsonExecutionResult(QueryResult& queryResult) co
printString += escapeJsonString(colNames[i]);
printString += jsonDrawingCharacters->KeyValue;
printString += jsonDrawingCharacters->KeyDelimiter;
printString += jsonDrawingCharacters->KeyValue;
auto valueTypeID = tuple->getValue(i)->getDataType().getLogicalTypeID();
if (valueTypeID == common::LogicalTypeID::STRING ||
valueTypeID == common::LogicalTypeID::BLOB) {
printString += jsonDrawingCharacters->KeyValue;
}
printString += escapeJsonString(tuple->getValue(i)->toString());
printString += jsonDrawingCharacters->KeyValue;
if (valueTypeID == common::LogicalTypeID::STRING ||
valueTypeID == common::LogicalTypeID::BLOB) {
printString += jsonDrawingCharacters->KeyValue;
}
if (i != queryResult.getNumColumns() - 1) {
printString += jsonDrawingCharacters->TupleDelimiter;
}
Expand Down

0 comments on commit 109012e

Please sign in to comment.