Skip to content

Commit

Permalink
update default conf value
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxinshuo.db committed Jun 20, 2024
1 parent 2479e06 commit 86aca90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions cpp/core/config/GlutenConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const std::string kGzipWindowSize4k = "4096";
const std::string kParquetCompressionCodec = "spark.sql.parquet.compression.codec";

const std::string kColumnToRowMemoryThreshold = "spark.gluten.sql.columnToRowMemoryThreshold";
const std::string kColumnToRowMemoryDefaultThreshold = "67108864"; // 64MB

const std::string kUGIUserName = "spark.gluten.ugi.username";
const std::string kUGITokens = "spark.gluten.ugi.tokens";
Expand Down
13 changes: 8 additions & 5 deletions cpp/core/jni/JniWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,14 @@ Java_org_apache_gluten_vectorized_NativeColumnarToRowJniWrapper_nativeColumnarTo
auto columnarToRowConverter = ctx->objectStore()->retrieve<ColumnarToRowConverter>(c2rHandle);
auto cb = ctx->objectStore()->retrieve<ColumnarBatch>(batchHandle);

int64_t column2RowMemThreshold = 256 * 1024 * 1024;
if (auto it = conf.find(kColumnToRowMemoryThreshold); it != conf.end()) {
if (std::all_of(it->second.begin(), it->second.end(), [](unsigned char c) { return std::isdigit(c); })) {
column2RowMemThreshold = std::stoll(it->second);
}
int64_t column2RowMemThreshold;
auto it = conf.find(kColumnToRowMemoryThreshold);
bool confIsLeagal =
std::all_of(it->second.begin(), it->second.end(), [](unsigned char c) { return std::isdigit(c); });
if (it != conf.end() && confIsLeagal) {
column2RowMemThreshold = std::stoll(it->second);
} else {
column2RowMemThreshold = std::stoll(kColumnToRowMemoryDefaultThreshold);
}

columnarToRowConverter->convert(cb, rowId, column2RowMemThreshold);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,8 @@ object GlutenConfig {
val GLUTEN_COLUMNAR_TO_ROW_MEM_THRESHOLD =
buildConf(GLUTEN_COLUMNAR_TO_ROW_MEM_THRESHOLD_KEY)
.internal()
.longConf
.createWithDefault(256 * 1024 * 1024)
.bytesConf(ByteUnit.BYTE)
.createWithDefaultString("64MB")

// if not set, use COLUMNAR_MAX_BATCH_SIZE instead
val SHUFFLE_WRITER_BUFFER_SIZE =
Expand Down

0 comments on commit 86aca90

Please sign in to comment.