Skip to content

Commit 70beb72

Browse files
fenzhuGitHub Enterprise
authored andcommitted
[CARMEL-6076][Followup] Fix the incorrect qualified table path to determine the read lock (#1020)
* [CARMEL-6076][Followup] Fix the incorrect qualified table path to determine the read lock
1 parent 34780ad commit 70beb72

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InMemoryFileIndex.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,17 @@ object InMemoryFileIndex extends Logging {
216216
))
217217

218218
val validTableLocation: Option[URI] = if (tableLocation != null && tableLocation.isDefined) {
219-
val tl = new Path(tableLocation.get.getPath.trim)
220-
val fs = SparkHadoopWriterUtils.getNewFileSystem(tl, hadoopConf)
221-
val tlp = fs.makeQualified(tl).toString.toLowerCase(Locale.ROOT)
219+
val tl = new Path(tableLocation.get).toString.trim
220+
val tll = tl.toLowerCase(Locale.ROOT)
222221
val readLockCluster = sparkSession.sessionState.conf.concurrentReadLockCluster
223222
logInfo(s"Configured cluster that enables read lock for empty directory: $readLockCluster")
224223
if (readLockCluster.trim.equalsIgnoreCase("all")) {
225224
tableLocation
226225
} else {
227226
val readLockClusters: Seq[String] =
228227
readLockCluster.split(",").toSeq.map(_.trim.toLowerCase(Locale.ROOT))
229-
val enforced: Boolean = readLockClusters.exists(cluster => tlp.contains(cluster))
230-
logInfo(s"Table location is: $tlp, read lock enforced = $enforced")
228+
val enforced: Boolean = readLockClusters.exists(cluster => tll.contains(cluster))
229+
logInfo(s"Table location is: $tl, read lock enforced = $enforced")
231230
if (enforced) tableLocation else null
232231
}
233232
} else {

0 commit comments

Comments
 (0)