Github user kunal642 commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2406#discussion_r200554007 --- Diff: core/src/main/java/org/apache/carbondata/core/locks/CarbonLockFactory.java --- @@ -52,44 +55,56 @@ */ public static ICarbonLock getCarbonLockObj(AbsoluteTableIdentifier absoluteTableIdentifier, String lockFile) { - - String tablePath = absoluteTableIdentifier.getTablePath(); + String tablePath; + if (lockPath.isEmpty()) { + tablePath = absoluteTableIdentifier.getTablePath(); + } else { + if (absoluteTableIdentifier + .getCarbonTableIdentifier().getTableId().isEmpty()) { + throw new RuntimeException("Table id is empty"); + } + tablePath = lockPath + CarbonCommonConstants.FILE_SEPARATOR + absoluteTableIdentifier + .getCarbonTableIdentifier().getTableId(); + } if (lockTypeConfigured.equals(CarbonCommonConstants.CARBON_LOCK_TYPE_ZOOKEEPER)) { - return new ZooKeeperLocking(absoluteTableIdentifier, lockFile); - } else if (tablePath.startsWith(CarbonCommonConstants.S3A_PREFIX) || - tablePath.startsWith(CarbonCommonConstants.S3N_PREFIX) || - tablePath.startsWith(CarbonCommonConstants.S3_PREFIX)) { + return new ZooKeeperLocking(tablePath, lockFile); + } else if (tablePath.startsWith(CarbonCommonConstants.S3A_PREFIX) || tablePath + .startsWith(CarbonCommonConstants.S3N_PREFIX) || tablePath + .startsWith(CarbonCommonConstants.S3_PREFIX)) { lockTypeConfigured = CarbonCommonConstants.CARBON_LOCK_TYPE_S3; - return new S3FileLock(absoluteTableIdentifier, lockFile); + return new S3FileLock(tablePath, --- End diff -- currently lock type is only used for Zookeeper locking other directly create the desired lock based on the path URI.
---