ulysses-you commented on code in PR #8386:
URL: https://github.com/apache/incubator-gluten/pull/8386#discussion_r1900497275


##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala:
##########
@@ -337,10 +338,14 @@ object VeloxBackendSettings extends BackendSettingsApi {
     }
 
     def validateBucketSpec(): Option[String] = {
-      if (bucketSpec.nonEmpty) {
-        Some("Unsupported native write: bucket write is not supported.")
-      } else {
+      val isHiveCompatibleBucketTable = bucketSpec.nonEmpty && options
+        .getOrElse("__hive_compatible_bucketed_table_insertion__", "false")
+        .equals("true")
+      // Support hive compatible bucket and partition table.
+      if (bucketSpec.isEmpty || (isHiveCompatibleBucketTable && 
isPartitionedTable)) {

Review Comment:
   Why it requires partitioned table ?



##########
cpp/velox/substrait/SubstraitToVeloxPlan.cc:
##########
@@ -517,12 +517,8 @@ std::shared_ptr<connector::hive::LocationHandle> 
makeLocationHandle(
     const std::optional<std::string>& writeDirectory = std::nullopt,
     const connector::hive::LocationHandle::TableType& tableType =
         connector::hive::LocationHandle::TableType::kExisting) {
-  std::string targetFileName = "";
-  if (fileFormat == dwio::common::FileFormat::PARQUET) {
-    targetFileName = fmt::format("gluten-part-{}{}{}", makeUuid(), 
compressionFileNameSuffix(compression), ".parquet");
-  }
   return std::make_shared<connector::hive::LocationHandle>(
-      targetDirectory, writeDirectory.value_or(targetDirectory), tableType, 
targetFileName);

Review Comment:
   I think we should only use hive style file name for bucketed writing, and 
for a non-bucketed table, keep previous behavior.



##########
docs/developers/SubstraitModifications.md:
##########
@@ -28,6 +28,7 @@ changed `Unbounded` in `WindowFunction` into 
`Unbounded_Preceding` and `Unbounde
 * Added `WriteRel` 
([#3690](https://github.com/apache/incubator-gluten/pull/3690)).
 * Added `TopNRel` 
([#5409](https://github.com/apache/incubator-gluten/pull/5409)).
 * Added `ref` field in window bound `Preceding` and `Following` 
([#5626](https://github.com/apache/incubator-gluten/pull/5626)).
+* Added `BucketSpec` field in 
`WriteRel`([](https://github.com/apache/incubator-gluten/pull/))

Review Comment:
   miss pr number



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to