From 2541e2c88913d115cbe85312d1dc0202457c050c Mon Sep 17 00:00:00 2001
From: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
Date: Mon, 18 Jul 2022 17:13:41 -0400
Subject: [PATCH] Remove preserve_order feature from serde_json (#2095) (#2098)
* Remove preserve_order feature from serde_json (#2095)
* Fix tests
---
arrow/Cargo.toml | 2 +-
arrow/src/json/writer.rs | 93 ++++++++++++++++++++--------------
integration-testing/Cargo.toml | 2 +-
parquet/Cargo.toml | 12 ++---
4 files changed, 62 insertions(+), 47 deletions(-)
diff --git a/arrow/Cargo.toml b/arrow/Cargo.toml
index 7b3d4c64ad7..151cd298793 100644
--- a/arrow/Cargo.toml
+++ b/arrow/Cargo.toml
@@ -41,7 +41,7 @@ bench = false
ahash = { version = "0.7", default-features = false }
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", default-features = false }
-serde_json = { version = "1.0", default-features = false, features = ["preserve_order"] }
+serde_json = { version = "1.0", default-features = false, features = ["std"] }
indexmap = { version = "1.9", default-features = false, features = ["std"] }
rand = { version = "0.8", default-features = false, features = ["std", "std_rng"], optional = true }
num = { version = "0.4", default-features = false, features = ["std"] }
diff --git a/arrow/src/json/writer.rs b/arrow/src/json/writer.rs
index 0755a5758e4..f21dad04313 100644
--- a/arrow/src/json/writer.rs
+++ b/arrow/src/json/writer.rs
@@ -745,6 +745,21 @@ mod tests {
use super::*;
+ /// Asserts that the NDJSON `input` is semantically identical to `expected`
+ fn assert_json_eq(input: &[u8], expected: &str) {
+ let expected: Vec