From 48cd37399818bf0861b81c0a418a583ad0f238d6 Mon Sep 17 00:00:00 2001 From: Chang Chen Date: Fri, 16 Aug 2024 21:09:24 +0800 Subject: [PATCH] fix ut for spark 35 --- ...tenClickHouseMergeTreeWriteOnS3Suite.scala | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseMergeTreeWriteOnS3Suite.scala b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseMergeTreeWriteOnS3Suite.scala index 6a473cc54f7ec..87e95cbe9dda6 100644 --- a/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseMergeTreeWriteOnS3Suite.scala +++ b/backends-clickhouse/src/test/scala/org/apache/gluten/execution/GlutenClickHouseMergeTreeWriteOnS3Suite.scala @@ -188,20 +188,33 @@ class GlutenClickHouseMergeTreeWriteOnS3Suite var metadataGlutenExist: Boolean = false var metadataBinExist: Boolean = false var dataBinExist: Boolean = false + var hasCommits = false client .listObjects(args) .forEach( obj => { objectCount += 1 - if (obj.get().objectName().contains("metadata.gluten")) { + val objectName = obj.get().objectName() + if (objectName.contains("metadata.gluten")) { metadataGlutenExist = true - } else if (obj.get().objectName().contains("meta.bin")) { + } else if (objectName.contains("meta.bin")) { metadataBinExist = true - } else if (obj.get().objectName().contains("data.bin")) { + } else if (objectName.contains("data.bin")) { dataBinExist = true + } else if (objectName.contains("_commits")) { + // Spark 35 has _commits directory + // table/_delta_log/_commits/ + hasCommits = true } }) - assertResult(5)(objectCount) + + if (isSparkVersionGE("3.5")) { + assertResult(6)(objectCount) + assert(hasCommits) + } else { + assertResult(5)(objectCount) + } + assert(metadataGlutenExist) assert(metadataBinExist) assert(dataBinExist)