diff --git a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala index 034a5d5f1743..f6ed91055ebf 100644 --- a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala +++ b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala @@ -351,7 +351,7 @@ object VeloxBackendSettings extends BackendSettingsApi { // is limited to partitioned tables. Therefore, we should add this condition restriction. // After velox supports bucketed non-partitioned tables, we can remove the restriction on // partitioned tables. - if (bucketSpec.isEmpty || (isHiveCompatibleBucketTable && isPartitionedTable)) { + if (bucketSpec.isEmpty || isHiveCompatibleBucketTable) { None } else { Some("Unsupported native write: non-compatible hive bucket write is not supported.") diff --git a/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetWriteForHiveSuite.scala b/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetWriteForHiveSuite.scala index e77a98df35ad..71b965cd2947 100644 --- a/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetWriteForHiveSuite.scala +++ b/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetWriteForHiveSuite.scala @@ -271,7 +271,7 @@ class VeloxParquetWriteForHiveSuite } } - test("bucket writer with non-dynamic partition should fallback") { + test("bucket writer with non-dynamic partition") { if (isSparkVersionGE("3.4")) { Seq("true", "false").foreach { enableConvertMetastore => @@ -293,7 +293,7 @@ class VeloxParquetWriteForHiveSuite // hive relation convert always use dynamic, so it will offload to native. checkNativeWrite( s"INSERT INTO $target PARTITION(k='0') SELECT i, j FROM $source", - checkNative = enableConvertMetastore.toBoolean) + checkNative = true) val files = tableDir(target) .listFiles() .filterNot(f => f.getName.startsWith(".") || f.getName.startsWith("_")) @@ -305,7 +305,7 @@ class VeloxParquetWriteForHiveSuite } } - test("bucket writer with non-partition table should fallback") { + test("bucket writer with non-partition table") { if (isSparkVersionGE("3.4")) { Seq("true", "false").foreach { enableConvertMetastore => @@ -323,7 +323,7 @@ class VeloxParquetWriteForHiveSuite (0 until 50).map(i => (i % 13, i.toString)).toDF("i", "j") df.write.mode(SaveMode.Overwrite).saveAsTable(source) - checkNativeWrite(s"INSERT INTO $target SELECT i, j FROM $source", checkNative = false) + checkNativeWrite(s"INSERT INTO $target SELECT i, j FROM $source", checkNative = true) checkAnswer(spark.table(target), df) }