You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/11/27 06:08:17 UTC
[GitHub] [carbondata] VenuReddy2103 commented on a change in pull request #4000: [CARBONDATA-4020] Fixed drop index when multiple index exists
VenuReddy2103 commented on a change in pull request #4000:
URL: https://github.com/apache/carbondata/pull/4000#discussion_r531399137
##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/DropIndexCommand.scala
##########
@@ -184,10 +184,12 @@ private[sql] case class DropIndexCommand(
parentCarbonTable = getRefreshedParentTable(sparkSession, dbName)
val indexMetadata = parentCarbonTable.getIndexMetadata
if (null != indexMetadata && null != indexMetadata.getIndexesMap) {
- val hasCgFgIndexes =
- !(indexMetadata.getIndexesMap.size() == 1 &&
- indexMetadata.getIndexesMap.containsKey(IndexType.SI.getIndexProviderName))
- if (hasCgFgIndexes) {
+ // check if any CG or FG index exists. If not exists,
+ // then set indexExists as false to return empty index list for next query.
+ val hasCgFgIndexes = indexMetadata.getIndexesMap.size() != 0 &&
Review comment:
`indexMetadata.getIndexesMap.size() != 0` would always be true at this point. `indexMetadata` will be null if empty.
----------------------------------------------------------------
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:
users@infra.apache.org