westonpace commented on code in PR #14402:
URL: https://github.com/apache/arrow/pull/14402#discussion_r994926310


##########
cpp/src/arrow/engine/substrait/serde_test.cc:
##########
@@ -402,22 +402,36 @@ TEST(Substrait, SupportedLiterals) {
   auto ExpectEq = [](std::string_view json, Datum expected_value) {
     ARROW_SCOPED_TRACE(json);
 
-    ASSERT_OK_AND_ASSIGN(
-        auto buf, internal::SubstraitFromJSON("Expression",
-                                              "{\"literal\":" + 
std::string(json) + "}"));
-    ExtensionSet ext_set;
-    ASSERT_OK_AND_ASSIGN(auto expr, DeserializeExpression(*buf, ext_set));
+    for (bool nullable : {false, true}) {
+      std::string json_with_nullable;
+      std::string nullable_json = (nullable) ? ", \"nullable\": true" : "";
+      if (nullable) {
+        auto final_closing_brace = json.find_last_of('}');
+        ASSERT_NE(std::string_view::npos, final_closing_brace);
+        json_with_nullable =
+            std::string(json.substr(0, final_closing_brace)) + ", 
\"nullable\": true}";
+        json = json_with_nullable;
+      }

Review Comment:
   Whoops, yeah, `nullable_json` was an earlier attempt and should just be 
removed.  The point on ignoring unknown fields is a good one though.  I'll make 
a crack at it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to