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 @@ -82,6 +83,8 @@ public void testDateHandling() throws IOException
schemaAsDate,
JSONPathSpec.DEFAULT
);
ObjectMapper objectMapperString = new ObjectMapper();
ObjectMapper objectMapperDate = new ObjectMapper();
List<InputRowListPlusRawValues> sampledAsString = sampleAllRows(readerAsString);
List<InputRowListPlusRawValues> sampledAsDate = sampleAllRows(readerAsDate);
final String expectedJson = "{\n"
Expand All @@ -91,8 +94,8 @@ public void testDateHandling() throws IOException
+ " \"idx\" : 1,\n"
+ " \"date_as_date\" : 1497744000000\n"
+ "}";
Assert.assertEquals(expectedJson, DEFAULT_JSON_WRITER.writeValueAsString(sampledAsString.get(0).getRawValues()));
Assert.assertEquals(expectedJson, DEFAULT_JSON_WRITER.writeValueAsString(sampledAsDate.get(0).getRawValues()));
Assert.assertEquals(objectMapperString.readTree(expectedJson), objectMapperString.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampledAsString.get(0).getRawValues())));
Assert.assertEquals(objectMapperDate.readTree(expectedJson), objectMapperDate.readTree(DEFAULT_JSON_WRITER.writeValueAsString(sampledAsDate.get(0).getRawValues())));
}

@Test
Expand Down