lw309637554 commented on a change in pull request #2136: URL: https://github.com/apache/hudi/pull/2136#discussion_r511595506
########## File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/AbstractHoodieClient.java ########## @@ -124,9 +128,30 @@ public HoodieWriteConfig getConfig() { return config; } + private void checkIndexTypeCompatible(String writeIndexType, String persistIndexType) { + if (writeIndexType.equals(persistIndexType)) { + return; + } else { + if ((persistIndexType.equals(HoodieIndex.IndexType.GLOBAL_BLOOM.name()) + && (writeIndexType.equals(HoodieIndex.IndexType.BLOOM.name()) || writeIndexType.equals(HoodieIndex.IndexType.SIMPLE.name()))) + || writeIndexType.equals(HoodieIndex.IndexType.INMEMORY.name())) { + return; + } else { + throw new HoodieException("The new write indextype " + writeIndexType Review comment: Understand what you mean. it is so helpful 1. As index is pluggable. In class SparkHoodieIndex will first construct index using hoodie.index.class, at this time the indextype will be null. 2. I think should to add indexType() to HoodieIndex class. And the index type should get from indexType() . 3. also the checkIndexTypeCompatible can in SparkHoodieIndex.createIndex 4. the index type persist to properties file ,should get from SparkHoodieIndex.createIndex().indexType() also other pluggable with more than one parameter control implement should do like this to get the implement type. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org