Skip to content

Commit ad428cb

Browse files
fix failed tests
1 parent 2488479 commit ad428cb

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

extensions/spark/kyuubi-spark-connector-hive/src/test/scala/org/apache/kyuubi/spark/connector/hive/HiveFileStatusCacheSuite.scala

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -255,35 +255,35 @@ class HiveFileStatusCacheSuite extends KyuubiHiveTest {
255255
val catalog2 = "hive2"
256256
val dbName = "default"
257257
val tbName = "tbl_partition"
258-
val dbTableShortName = s"${dbName}.${tbName}"
259-
val cat1Table = s"${catalog1}.${dbTableShortName}"
260-
val cat2Table = s"${catalog2}.${dbTableShortName}"
258+
val cat1Table = s"${catalog1}.${dbName}.${tbName}"
259+
val cat2Table = s"${catalog2}.${dbName}.${tbName}"
261260

262261
withTable(cat1Table, cat2Table) {
263262
spark.sql(s"CREATE TABLE IF NOT EXISTS $cat1Table (age int)partitioned by(city string)" +
264263
s" stored as orc").collect()
264+
spark.sql(s"CREATE TABLE IF NOT EXISTS $cat2Table (age int)partitioned by(city string)" +
265+
s" stored as orc").collect()
266+
265267
val location = newCatalog()
266268
.loadTable(Identifier.of(Array(dbName), tbName))
267269
.asInstanceOf[HiveTable]
268270
.catalogTable.location.toString
269271

270-
spark.sql(s"use $catalog1").collect()
271-
spark.sql(s"insert into $dbTableShortName partition(city='ct1') " +
272+
spark.sql(s"insert into $cat1Table partition(city='ct1') " +
272273
s"values(11),(12),(13),(14),(15)").collect()
273274
spark.sql(s"select * from $cat1Table where city='ct1'").collect()
274275
assert(HiveFileStatusCache.getOrCreate(spark, cat1Table)
275-
.getLeafFiles(new Path(s"$location/city=ct1"))
276-
.isDefined)
276+
.getLeafFiles(new Path(s"$location/city=ct1")).isDefined)
277+
assert(HiveFileStatusCache.getOrCreate(spark, cat2Table)
278+
.getLeafFiles(new Path(s"$location/city=ct1")).isEmpty)
277279

278-
spark.sql(s"use $catalog2").collect()
279-
spark.sql(s"insert into $dbTableShortName partition(city='ct2') " +
280+
spark.sql(s"insert into $cat2Table partition(city='ct2') " +
280281
s"values(21),(22),(23),(24),(25)").collect()
281282
spark.sql(s"select * from $cat2Table where city='ct2'").collect()
283+
assert(HiveFileStatusCache.getOrCreate(spark, cat1Table)
284+
.getLeafFiles(new Path(s"$location/city=ct2")).isEmpty)
282285
assert(HiveFileStatusCache.getOrCreate(spark, cat2Table)
283-
.getLeafFiles(new Path(s"$location/city=ct1")).isEmpty)
284-
assert(HiveFileStatusCache.getOrCreate(spark, cat2Table)
285-
.getLeafFiles(new Path(s"$location/city=ct2"))
286-
.isDefined)
286+
.getLeafFiles(new Path(s"$location/city=ct2")).isDefined)
287287
}
288288
}
289289
}

0 commit comments

Comments
 (0)