Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2998#discussion_r243489099
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/CarbonSource.scala ---
@@ -331,7 +333,17 @@ object CarbonSource {
properties,
query)
// updating params
- val updatedFormat = storageFormat.copy(properties = map)
+ var updatedFormat: CatalogStorageFormat = null
+ // check if catalog table location is empty or if differs from
tablepath, then change the
+ // value of locationUri to tablepath
+ if (SparkUtil.isSparkVersionXandAbove("2.2") &&
tableDesc.storage.locationUri.isEmpty) {
+ updatedFormat =
CarbonToSparkAdapater.getUpdatedStorageFormat(storageFormat, map, tablePath)
+ } else if (SparkUtil.isSparkVersionXandAbove("2.2") &&
+
!tableDesc.storage.locationUri.toString.equalsIgnoreCase(tablePath)) {
--- End diff --
Please check this equals check , because `locationUri` may comes with file
protocol also like `file:/` or `hdfs:/` , in case of local file the `file:/`
may not be present so this equals check fails.
---