Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2257,16 +2257,17 @@ class MiscOperatorSuite extends VeloxWholeStageTransformerSuite with AdaptiveSpa
val ex = intercept[IllegalArgumentException] {
GlutenShuffleUtils.getCompressionCodec(conf)
}
assert(ex.getMessage.contains("snappy is not supported"))
assert(ex.getMessage.contains("does not support codec 'snappy'"))
assert(ex.getMessage.contains("spark.shuffle.compress=false"))
assert(ex.getMessage.contains(GlutenConfig.COLUMNAR_SHUFFLE_CODEC.key))
}

test("GLUTEN-11539: spark.io.compression.codec=none throws with actionable message") {
test("GLUTEN-11539: spark.io.compression.codec=none throws pointing to spark.shuffle.compress") {
val conf = spark.sparkContext.getConf.clone().set("spark.io.compression.codec", "none")
val ex = intercept[IllegalArgumentException] {
GlutenShuffleUtils.getCompressionCodec(conf)
}
assert(ex.getMessage.contains("none is not supported"))
assert(ex.getMessage.contains("spark.shuffle.compress=false"))
assert(ex.getMessage.contains(GlutenConfig.COLUMNAR_SHUFFLE_CODEC.key))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ object GlutenShuffleUtils {
val supportedCodecs = BackendsApiManager.getSettings.shuffleSupportedCodec()
if (!supportedCodecs.contains(codec)) {
throw new IllegalArgumentException(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding a special judgment for "none", can you just refine the current error message for all invalid input?

            throw new IllegalArgumentException(
              s"Gluten shuffle does not support codec '$codec'. " +
                s"To disable shuffle compression, set spark.shuffle.compress=false. " +
                s"To use a supported codec, set ${GlutenConfig.COLUMNAR_SHUFFLE_CODEC.key} " +
                s"to ${supportedCodecs.mkString(" or ")}.")

In fact, spark throws same exception for all invalid codecs, and I don't find there's any document in spark saying "none" means uncompressed in spark.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point — simplified in the latest commit. The unified message now reads:

Gluten shuffle does not support codec '$codec'. To disable shuffle compression, set spark.shuffle.compress=false. To use a supported codec, set spark.gluten.sql.columnar.shuffle.codec to lz4 or zstd.

This covers all invalid inputs (including none) without special-casing.

s"Gluten shuffle only supports ${supportedCodecs.mkString(", ")}. " +
s"$codec is not supported. " +
s"You may configure ${GlutenConfig.COLUMNAR_SHUFFLE_CODEC.key} " +
s"Gluten shuffle does not support codec '$codec'. " +
s"To disable shuffle compression, set spark.shuffle.compress=false. " +
s"To use a supported codec, set ${GlutenConfig.COLUMNAR_SHUFFLE_CODEC.key} " +
s"to ${supportedCodecs.mkString(" or ")}.")
}
codec
Expand Down
Loading