Skip to content
Closed
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 @@ -94,6 +94,8 @@ class ConfigEntrySuite extends SparkFunSuite {
assert(conf.get(bytes) === 1024L)
conf.set(bytes.key, "1k")
assert(conf.get(bytes) === 1L)
conf.set(bytes.key, "2048")
assert(conf.get(bytes) === 2048)
}

test("conf entry: regex") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1415,8 +1415,8 @@ object SQLConf {
" bigger files (which is scheduled first). This configuration is effective only when using" +
" file-based sources such as Parquet, JSON and ORC.")
.version("2.0.0")
.longConf
.createWithDefault(4 * 1024 * 1024)
.bytesConf(ByteUnit.BYTE)
.createWithDefaultString("4MB")
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a simple test at ConfigEntrySuite to make sure byte configuration is able to take the long type numbers?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1; we could probably extend this existing test:

test("conf entry: bytes") {
val conf = new SparkConf()
val bytes = ConfigBuilder(testKey("bytes")).bytesConf(ByteUnit.KiB)
.createWithDefaultString("1m")
assert(conf.get(bytes) === 1024L)
conf.set(bytes.key, "1k")
assert(conf.get(bytes) === 1L)
}


val FILES_MIN_PARTITION_NUM = buildConf("spark.sql.files.minPartitionNum")
.doc("The suggested (not guaranteed) minimum number of split file partitions. " +
Expand Down