Skip to content

Commit

Permalink
[GLUTEN-6124][CH]Fix json output diff (#6125)
Browse files Browse the repository at this point in the history
What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)

(Fixes: #6124)

How was this patch tested?
TEST BY UT
  • Loading branch information
KevinyhZou authored Jun 26, 2024
1 parent a51f693 commit 774c668
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2048,10 +2048,15 @@ class GlutenClickHouseTPCHSaltNullParquetSuite extends GlutenClickHouseTPCHAbstr
"""
|select to_json(struct(cast(id as string), id, 1.1, 1.1f, 1.1d)) from range(3)
|""".stripMargin
val sql1 =
"""
| select to_json(named_struct('name', concat('/val/', id))) from range(3)
|""".stripMargin
// cast('nan' as double) output 'NaN' in Spark, 'nan' in CH
// cast('inf' as double) output 'Infinity' in Spark, 'inf' in CH
// ignore them temporarily
runQueryAndCompare(sql)(checkGlutenOperatorMatch[ProjectExecTransformer])
runQueryAndCompare(sql1)(checkGlutenOperatorMatch[ProjectExecTransformer])
}

test("GLUTEN-3501: test json output format with struct contains null value") {
Expand Down
2 changes: 1 addition & 1 deletion cpp-ch/local-engine/Common/CHUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@ void BackendInitializerUtil::initSettings(std::map<std::string, std::string> & b
LOG_DEBUG(&Poco::Logger::get("CHUtil"), "Set settings key:{} value:{}", key, value);
}
}

/// Finally apply some fixed kvs to settings.
settings.set("join_use_nulls", true);
settings.set("input_format_orc_allow_missing_columns", true);
Expand All @@ -694,6 +693,7 @@ void BackendInitializerUtil::initSettings(std::map<std::string, std::string> & b
settings.set("output_format_json_quote_64bit_integers", false);
settings.set("output_format_json_quote_denormals", true);
settings.set("output_format_json_skip_null_value_in_named_tuples", true);
settings.set("output_format_json_escape_forward_slashes", false);
settings.set("function_json_value_return_type_allow_complex", true);
settings.set("function_json_value_return_type_allow_nullable", true);
settings.set("precise_float_parsing", true);
Expand Down

0 comments on commit 774c668

Please sign in to comment.