Skip to content

Commit

Permalink
chore: Disable shuffle by default and add unit test to prevent config…
Browse files Browse the repository at this point in the history
… regressions (apache#414)

* Set internal default configs

* add header

* comment out shuffle mode check

* revert shuffle mode default change

* revert enable shuffle by default

* update defaults
  • Loading branch information
andygrove authored and GitHub Enterprise committed Aug 30, 2024
1 parent b06b433 commit 9e517ef
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/src/main/scala/org/apache/comet/CometConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ object CometConf extends ShimCometConf {
"'spark.shuffle.manager' must be set before starting the Spark application and " +
"cannot be changed during the application.")
.booleanConf
.createWithDefault(true)
.createWithDefault(false)

val COMET_SHUFFLE_MODE: ConfigEntry[String] = conf(s"$COMET_EXEC_CONFIG_PREFIX.shuffle.mode")
.doc("The mode of Comet shuffle. This config is only effective if Comet shuffle " +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.comet

import org.apache.spark.sql.CometTestBase

class AppleDefaultConfigSuite extends CometTestBase {

test("Comet configuration defaults are as expected") {
// check that we haven't accidentally changed any defaults when we merge changes from OSS Comet

// scans should be enabled by default
assert(CometConf.COMET_NATIVE_SCAN_ENABLED.defaultValue.get)

// execs should be disabled by default and users can opt in to try out Comet
// we will enable by default once all memory and performance issues are resolved
assert(!CometConf.COMET_EXEC_ENABLED.defaultValue.get)

// individual execs all default to enabled
assert(CometConf.COMET_EXEC_AGGREGATE_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_BROADCAST_EXCHANGE_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_BROADCAST_HASH_JOIN_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_COALESCE_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_COLLECT_LIMIT_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_EXPAND_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_FILTER_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_GLOBAL_LIMIT_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_HASH_JOIN_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_LOCAL_LIMIT_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_PROJECT_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_SORT_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_SORT_MERGE_JOIN_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_TAKE_ORDERED_AND_PROJECT_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_UNION_ENABLED.defaultValue.get)
assert(CometConf.COMET_EXEC_WINDOW_ENABLED.defaultValue.get)

// shuffle is disabled by default
assert(!CometConf.COMET_EXEC_SHUFFLE_ENABLED.defaultValue.get)
assert("auto" == CometConf.COMET_SHUFFLE_MODE.defaultValue.get)
}

}

0 comments on commit 9e517ef

Please sign in to comment.