Jackie-Jiang commented on code in PR #8514: URL: https://github.com/apache/pinot/pull/8514#discussion_r859212236
########## pinot-spi/src/main/java/org/apache/pinot/spi/utils/JsonUtils.java: ########## @@ -71,12 +79,53 @@ private JsonUtils() { public static final ObjectReader DEFAULT_READER = DEFAULT_MAPPER.reader(); public static final ObjectWriter DEFAULT_WRITER = DEFAULT_MAPPER.writer(); public static final ObjectWriter DEFAULT_PRETTY_WRITER = DEFAULT_MAPPER.writerWithDefaultPrettyPrinter(); + private static final TypeReference<HashMap<String, Object>> GENERIC_JSON_TYPE = + new TypeReference<HashMap<String, Object>>() { }; public static <T> T stringToObject(String jsonString, Class<T> valueType) throws IOException { return DEFAULT_READER.forType(valueType).readValue(jsonString); } + public static <T> Pair<T, Map<String, Object>> stringToObjectAndUnparseableProps(String jsonString, Review Comment: Suggest renaming ```suggestion public static <T> Pair<T, Map<String, Object>> stringToObjectAndUnrecognizedProperties(String jsonString, ``` ########## pinot-spi/src/test/java/org/apache/pinot/spi/utils/JsonUtilsTest.java: ########## @@ -273,6 +274,20 @@ public void testFlatten() } } + @Test + public void testUnparseableJson() throws Exception { Review Comment: Suggest renaming ```suggestion public void testUnrecognizedProperties() throws Exception { ``` ########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java: ########## @@ -153,16 +155,18 @@ public class PinotTableRestletResource { @Produces(MediaType.APPLICATION_JSON) @Path("/tables") @ApiOperation(value = "Adds a table", notes = "Adds a table") - public SuccessResponse addTable( + public ConfigSuccessResponse addTable( String tableConfigStr, @ApiParam(value = "comma separated list of validation type(s) to skip. supported types: (ALL|TASK|UPSERT)") @QueryParam("validationTypesToSkip") @Nullable String typesToSkip, @Context HttpHeaders httpHeaders, @Context Request request) { // TODO introduce a table config ctor with json string. + Pair<TableConfig, Map<String, Object>> tableConfigAndUnparsedProps; Review Comment: Suggest renaming ```suggestion Pair<TableConfig, Map<String, Object>> tableConfigAndUnrecognizedProperties; ``` -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org