Skip to content
Permalink
Browse files
[refactor] some code cleanup for min/max function. (#8874)
  • Loading branch information
zhannngchen committed May 7, 2022
1 parent 9bae0a6 commit 4235db8902c1c412c5dc64378eeb32dd8997e938
Showing 2 changed files with 9 additions and 37 deletions.
@@ -656,22 +656,6 @@ void AggregateFunctions::min(FunctionContext*, const DecimalV2Val& src, DecimalV
}
}

template <>
void AggregateFunctions::min(FunctionContext*, const LargeIntVal& src, LargeIntVal* dst) {
if (src.is_null) {
return;
}

if (dst->is_null) {
*dst = src;
return;
}

if (src.val < dst->val) {
dst->val = src.val;
}
}

template <>
void AggregateFunctions::max(FunctionContext*, const DecimalV2Val& src, DecimalV2Val* dst) {
if (src.is_null) {
@@ -690,22 +674,6 @@ void AggregateFunctions::max(FunctionContext*, const DecimalV2Val& src, DecimalV
}
}

template <>
void AggregateFunctions::max(FunctionContext*, const LargeIntVal& src, LargeIntVal* dst) {
if (src.is_null) {
return;
}

if (dst->is_null) {
*dst = src;
return;
}

if (src.val > dst->val) {
dst->val = src.val;
}
}

void AggregateFunctions::init_null_string(FunctionContext* c, StringVal* dst) {
dst->is_null = true;
dst->ptr = nullptr;
@@ -2680,6 +2648,8 @@ template void AggregateFunctions::min<SmallIntVal>(FunctionContext*, const Small
template void AggregateFunctions::min<IntVal>(FunctionContext*, const IntVal& src, IntVal* dst);
template void AggregateFunctions::min<BigIntVal>(FunctionContext*, const BigIntVal& src,
BigIntVal* dst);
template void AggregateFunctions::min<LargeIntVal>(FunctionContext*, const LargeIntVal& src,
LargeIntVal* dst);
template void AggregateFunctions::min<FloatVal>(FunctionContext*, const FloatVal& src,
FloatVal* dst);
template void AggregateFunctions::min<DoubleVal>(FunctionContext*, const DoubleVal& src,
@@ -2728,6 +2698,8 @@ template void AggregateFunctions::max<SmallIntVal>(FunctionContext*, const Small
template void AggregateFunctions::max<IntVal>(FunctionContext*, const IntVal& src, IntVal* dst);
template void AggregateFunctions::max<BigIntVal>(FunctionContext*, const BigIntVal& src,
BigIntVal* dst);
template void AggregateFunctions::max<LargeIntVal>(FunctionContext*, const LargeIntVal& src,
LargeIntVal* dst);
template void AggregateFunctions::max<FloatVal>(FunctionContext*, const FloatVal& src,
FloatVal* dst);
template void AggregateFunctions::max<DoubleVal>(FunctionContext*, const DoubleVal& src,
@@ -335,10 +335,10 @@ public class Config extends ConfigBase {
* and one thread can handle the read and write of many sockets, so the number of thread pools is small.
*
* For most projects, only 1-2 acceptors threads are needed, and 2 to 4 selectors threads are sufficient.
* Workers are obstructive business logic, often have more database operations, and require a large number of threads. T
* he specific number depends on the proportion of QPS and IO events of the application. The higher the QPS,
* the more threads are required, the higher the proportion of IO,
* the more threads waiting, and the more total threads required.
* Workers are obstructive business logic, often have more database operations, and require a large number of
* threads. The specific number depends on the proportion of QPS and IO events of the application. The higher the
* QPS, the more threads are required, the higher the proportion of IO, the more threads waiting, and the more
* total threads required.
*/
@ConfField public static int jetty_server_acceptors = 2;
@ConfField public static int jetty_server_selectors = 4;
@@ -354,7 +354,7 @@ public class Config extends ConfigBase {
@ConfField public static int jetty_threadPool_maxThreads = 400;

/**
* jetty Maximum number of bytes in put or post method,default:100MB
* Jetty maximum number of bytes in put or post method,default:100MB
*/
@ConfField public static int jetty_server_max_http_post_size = 100 * 1024 * 1024;

0 comments on commit 4235db8

Please sign in to comment.