Github user mohammadshahidkhan commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1418#discussion_r150442899 --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala --- @@ -839,14 +841,56 @@ object CommonUtil { */ def mergeIndexFiles(sparkContext: SparkContext, segmentIds: Seq[String], - storePath: String, + tablePath: String, carbonTable: CarbonTable): Unit = { if (CarbonProperties.getInstance().getProperty( CarbonCommonConstants.CARBON_MERGE_INDEX_IN_SEGMENT, CarbonCommonConstants.CARBON_MERGE_INDEX_IN_SEGMENT_DEFAULT).toBoolean) { - new CarbonMergeFilesRDD(sparkContext, AbsoluteTableIdentifier.from(storePath, + new CarbonMergeFilesRDD(sparkContext, AbsoluteTableIdentifier.from(tablePath, carbonTable.getDatabaseName, carbonTable.getFactTableName).getTablePath, segmentIds).collect() } } + + /** + * The default database and databases ending with .db will point to the + * either either "carbon.storeLocation" or "spark.sql.warehouse.dir". + * + * @param storeLocation + * @param databaseName + * @param fixedStorePath + * @return + */ + def getValidStorePath(storeLocation: String, databaseName: String, + fixedStorePath: String): String = { --- End diff -- fixed
---