gortiz commented on PR #20455: URL: https://github.com/apache/pinot/pull/20455#issuecomment-7416920308
A few comments: 1. Tests: the new tests show that an unrelated class isn't initialized, but nothing shows that a valid custom subclass with a static initializer still initializes and constructs through the new path. That's the back-compat guarantee for existing table configs that name custom classes. One positive test per factory (upsert, dedup, merger, `TextIndexUtils`) with a nested subclass whose static initializer sets a flag would cover it. 2. Nit: `TextIndexUtils.java:431`, `parseSupportedTypes` still loads any class named in `luceneAnalyzerClassArgTypes`, although `parseSupportedTypeValues` only accepts `String`, the boxed primitives and the `*.TYPE` names. Allow-listing those names before loading would be simpler. 3. Nit: the "load without initializing, then check the type" pattern is now repeated in six places across `TextIndexUtils`, `PartialUpsertMergerFactory`, `TableUpsertMetadataManagerFactory` and `TableDedupMetadataManagerFactory`. A small helper in `pinot-spi`, for example `loadClass(String name, Class<T> expectedType)`, would make it harder for a future call site to go back to the one-argument `Class.forName`. -- 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]
