Skip to content

Commit e8d9d86

Browse files
optimize: reduce a partitions call when checking permissions
Co-authored-by: Thomas Chow <[email protected]>
1 parent 2010a0b commit e8d9d86

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

spark/src/main/scala/ai/chronon/spark/TableUtils.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,8 @@ class TableUtils(@transient val sparkSession: SparkSession) extends Serializable
263263
logger.info(s"Checking permission for table $tableName...")
264264
try {
265265
// retrieve one row from the table
266-
val partitionFilter = lastAvailablePartition(tableName).getOrElse(fallbackPartition)
267266
sparkSession.read
268267
.load(DataPointer.from(tableName, sparkSession))
269-
.where(s"$partitionColumn='$partitionFilter'")
270268
.limit(1)
271269
.collect()
272270
true

0 commit comments

Comments
 (0)