deniskuzZ commented on code in PR #6943:
URL: https://github.com/apache/hive/pull/6943#discussion_r4466398976


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/impl/ColStatsStoreImpl.java:
##########
@@ -467,7 +467,7 @@ protected boolean canUseJdoQuery() throws MetaException {
       @Override
       protected Map<String, Map<String, String>> getJdoResult()

Review Comment:
   alternative approach would be DirectSqlOnlyHelper<A, T> extends GetHelper<A, 
T> with final overrides of canUseJdoQuery() (returns false) and getJdoResult() 
(throws). The direct-SQL-only helpers would then implement only getSqlResult() 
and describeResult(), and getJdoResult() stays abstract in GetHelper, so 
JDO-capable helpers keep the compile-time check.
   
   ````
   public abstract class DirectSqlOnlyHelper<A, T> extends GetHelper<A, T> {
   
     public DirectSqlOnlyHelper(RawStoreBundle rsb, A args) throws 
MetaException {
       super(rsb, args);
     }
   
     public DirectSqlOnlyHelper(RawStoreBundle rsb, A args, List<String> 
fields) throws MetaException {
       super(rsb, args, fields);
     }
   
     @Override
     protected final boolean canUseJdoQuery() {
       return false;
     }
   
     @Override
     protected final T getJdoResult() {
       // Never called: GetHelper always takes the direct SQL path for these 
operations, or fails.
       throw new UnsupportedOperationException("This operation is only 
supported by direct SQL");
     }
   }
   ````



-- 
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]

Reply via email to