clintropolis commented on code in PR #18169: URL: https://github.com/apache/druid/pull/18169#discussion_r2174420681
########## processing/src/test/java/org/apache/druid/segment/nested/StructuredDataTest.java: ########## @@ -95,6 +95,18 @@ public void testCompareTo() } + @Test + public void testCompareToWithDifferentJSONOrder() Review Comment: I actually think it is fine to only do the key ordering during comparison, and maybe even preferable since it leaves the 'raw' json identical to how it was ingested. >Enables better rollup during ingestion on json columns. Also, it would align with the current behavior of MySQL and Postgres's jsonb type. Postgres's json [type](https://www.postgresql.org/docs/current/datatype-json.html) preserves ingest-time order but doesn't support grouping on those columns. I would think the key ordering would have very limited impact on the rollup factor; the sorting here is arbitrary since there isn't really a natural way to sort json, so it just needs to be 'stable' so we don't run into the error this PR aims to fix (good find btw). -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
