Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.druid.data.input.parquet;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableList;
import org.apache.druid.data.input.ColumnsFilter;
import org.apache.druid.data.input.InputEntityReader;
Expand Down Expand Up @@ -92,8 +93,9 @@ public void testFlat1NoFlattenSpec() throws IOException
schema,
flattenSpec
);
ObjectMapper objectMapper = new ObjectMapper();
List<InputRowListPlusRawValues> sampled = sampleAllRows(reader);
Assert.assertEquals(FLAT_JSON, DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues()));
Assert.assertEquals(objectMapper.readTree(FLAT_JSON), objectMapper.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues())));
}

@Test
Expand Down Expand Up @@ -125,8 +127,9 @@ public void testFlat1Autodiscover() throws IOException
schema,
JSONPathSpec.DEFAULT
);
ObjectMapper objectMapper = new ObjectMapper();
List<InputRowListPlusRawValues> sampled = sampleAllRows(reader);
Assert.assertEquals(FLAT_JSON, DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues()));
Assert.assertEquals(objectMapper.readTree(FLAT_JSON), objectMapper.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues())));
}

@Test
Expand Down Expand Up @@ -166,8 +169,9 @@ public void testFlat1Flatten() throws IOException
schema,
flattenSpec
);
ObjectMapper objectMapper = new ObjectMapper();
List<InputRowListPlusRawValues> sampled = sampleAllRows(reader);
Assert.assertEquals(FLAT_JSON, DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues()));
Assert.assertEquals(objectMapper.readTree(FLAT_JSON), objectMapper.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues())));
}

@Test
Expand Down Expand Up @@ -204,9 +208,9 @@ public void testFlat1FlattenSelectListItem() throws IOException
schema,
flattenSpec
);
ObjectMapper objectMapper = new ObjectMapper();
List<InputRowListPlusRawValues> sampled = sampleAllRows(reader);

Assert.assertEquals(FLAT_JSON, DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues()));
Assert.assertEquals(objectMapper.readTree(FLAT_JSON), objectMapper.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues())));
}


Expand Down Expand Up @@ -242,8 +246,9 @@ public void testNested1NoFlattenSpec() throws IOException
schema,
flattenSpec
);
ObjectMapper objectMapper = new ObjectMapper();
List<InputRowListPlusRawValues> sampled = sampleAllRows(reader);
Assert.assertEquals(NESTED_JSON, DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues()));
Assert.assertEquals(objectMapper.readTree(NESTED_JSON), objectMapper.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues())));
}

@Test
Expand Down Expand Up @@ -275,8 +280,9 @@ public void testNested1Autodiscover() throws IOException
schema,
JSONPathSpec.DEFAULT
);
ObjectMapper objectMapper = new ObjectMapper();
List<InputRowListPlusRawValues> sampled = sampleAllRows(reader);
Assert.assertEquals(NESTED_JSON, DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues()));
Assert.assertEquals(objectMapper.readTree(NESTED_JSON), objectMapper.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues())));
}

@Test
Expand Down Expand Up @@ -318,8 +324,9 @@ public void testNested1Flatten() throws IOException
schema,
flattenSpec
);
ObjectMapper objectMapper = new ObjectMapper();
List<InputRowListPlusRawValues> sampled = sampleAllRows(reader);
Assert.assertEquals(NESTED_JSON, DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues()));
Assert.assertEquals(objectMapper.readTree(NESTED_JSON), objectMapper.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues())));
}

@Test
Expand Down Expand Up @@ -359,8 +366,10 @@ public void testNested1FlattenSelectListItem() throws IOException
schema,
flattenSpec
);
ObjectMapper objectMapper = new ObjectMapper();
List<InputRowListPlusRawValues> sampled = sampleAllRows(reader);
Assert.assertEquals(NESTED_JSON, DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues()));
Assert.assertEquals(objectMapper.readTree(NESTED_JSON), objectMapper.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampled.get(0).getRawValues())));

}

@Test
Expand Down