Skip to content

Commit

Permalink
Merge branch 'master' into compile_check-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mryange authored Oct 6, 2024
2 parents b5672e9 + 9b8e65b commit e06b3d3
Show file tree
Hide file tree
Showing 242 changed files with 15,975 additions and 856 deletions.
2 changes: 2 additions & 0 deletions be/src/cloud/cloud_stream_load_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "common/logging.h"
#include "common/status.h"
#include "runtime/stream_load/stream_load_context.h"
#include "util/debug_points.h"

namespace doris {

Expand Down Expand Up @@ -96,6 +97,7 @@ Status CloudStreamLoadExecutor::operate_txn_2pc(StreamLoadContext* ctx) {
}

Status CloudStreamLoadExecutor::commit_txn(StreamLoadContext* ctx) {
DBUG_EXECUTE_IF("StreamLoadExecutor.commit_txn.block", DBUG_BLOCK);
// forward to fe to excute commit transaction for MoW table
if (ctx->is_mow_table() || !config::enable_stream_load_commit_txn_on_be ||
ctx->load_type == TLoadType::ROUTINE_LOAD) {
Expand Down
8 changes: 5 additions & 3 deletions be/src/service/internal_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ void offer_failed(T* response, google::protobuf::Closure* done, const FifoThread
template <CanCancel T>
void offer_failed(T* response, google::protobuf::Closure* done, const FifoThreadPool& pool) {
brpc::ClosureGuard closure_guard(done);
response->mutable_status()->set_status_code(TStatusCode::CANCELLED);
response->mutable_status()->add_error_msgs("fail to offer request to the work pool, pool=" +
pool.get_info());
// Should use status to generate protobuf message, because it will encoding Backend Info
// into the error message and then we could know which backend's pool is full.
Status st = Status::Error<TStatusCode::CANCELLED>(
"fail to offer request to the work pool, pool={}", pool.get_info());
st.to_protobuf(response->mutable_status());
LOG(WARNING) << "cancelled due to fail to offer request to the work pool, pool="
<< pool.get_info();
}
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/common/pod_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ class PODArray : public PODArrayBase<sizeof(T), initial_bytes, TAllocator, pad_r

template <typename U, typename... TAllocatorParams>
void push_back(U&& x, TAllocatorParams&&... allocator_params) {
if (UNLIKELY(this->c_end + sizeof(T) > this->c_end_of_storage)) {
if (UNLIKELY(this->c_end == nullptr || this->c_end + sizeof(T) > this->c_end_of_storage)) {
this->reserve_for_next_size(std::forward<TAllocatorParams>(allocator_params)...);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
public class OracleJdbcExecutor extends BaseJdbcExecutor {
private static final Logger LOG = Logger.getLogger(OracleJdbcExecutor.class);
private final CharsetDecoder utf8Decoder = StandardCharsets.UTF_8.newDecoder();
private final boolean isNewJdbcVersion;

public OracleJdbcExecutor(byte[] thriftParams) throws Exception {
super(thriftParams);
isNewJdbcVersion = isJdbcVersionGreaterThanOrEqualTo("12.2.0");
}

@Override
Expand All @@ -65,7 +67,7 @@ protected void initializeBlock(int columnCount, String[] replaceStringList, int

@Override
protected Object getColumnValue(int columnIndex, ColumnType type, String[] replaceStringList) throws SQLException {
if (isJdbcVersionGreaterThanOrEqualTo("12.2.0")) {
if (isNewJdbcVersion) {
return newGetColumnValue(columnIndex, type, replaceStringList);
} else {
return oldGetColumnValue(columnIndex, type, replaceStringList);
Expand Down
3 changes: 3 additions & 0 deletions fe/fe-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,9 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>8</release>
</configuration>
<executions>
<!-- first: compile annotation and annotation processor -->
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,7 @@ private List<Column> checkAndPrepareMaterializedView(CreateMaterializedViewStmt
}

// check b.3
if (olapTable.getKeysType() == KeysType.UNIQUE_KEYS && !olapTable.getEnableUniqueKeyMergeOnWrite()
&& !addMVClause.isReplay()) {
if (olapTable.getKeysType() == KeysType.UNIQUE_KEYS && !addMVClause.isReplay()) {
Set<String> originColumns = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
for (Column column : newMVColumns) {
originColumns.add(CreateMaterializedViewStmt.mvColumnBreaker(column.getName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ public String getStringValueInFe(FormatOptions options) {
String timeStr = getStringValue();
return timeStr.substring(1, timeStr.length() - 1);
} else {
if (Double.isInfinite(getValue())) {
return Double.toString(getValue());
}
return BigDecimal.valueOf(getValue()).toPlainString();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private long connectionAgeExpiredAt() {
if (!isMetaServiceEndpointList && connectionAgeBase > 1) {
long base = TimeUnit.MINUTES.toMillis(connectionAgeBase);
long now = System.currentTimeMillis();
long rand = random.nextLong(base);
long rand = random.nextLong() % base;
return now + base + rand;
}
return Long.MAX_VALUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ public String toString() {
builder.append(" ");
builder.append(timeUnit);
if (!StringUtils.isEmpty(startTime)) {
builder.append(" STARTS ");
builder.append(" STARTS \"");
builder.append(startTime);
builder.append("\"");
}
return builder.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
package org.apache.doris.nereids.trees.expressions;

import org.apache.doris.catalog.Env;
import org.apache.doris.nereids.exceptions.NotSupportedException;
import org.apache.doris.nereids.trees.expressions.functions.BoundFunction;
import org.apache.doris.nereids.trees.expressions.functions.agg.AggregateFunction;
import org.apache.doris.nereids.trees.expressions.functions.executable.DateTimeAcquire;
import org.apache.doris.nereids.trees.expressions.functions.executable.DateTimeArithmetic;
import org.apache.doris.nereids.trees.expressions.functions.executable.DateTimeExtractAndTransform;
import org.apache.doris.nereids.trees.expressions.functions.executable.ExecutableFunctions;
import org.apache.doris.nereids.trees.expressions.functions.executable.NumericArithmetic;
import org.apache.doris.nereids.trees.expressions.functions.executable.StringArithmetic;
import org.apache.doris.nereids.trees.expressions.functions.executable.TimeRoundSeries;
Expand Down Expand Up @@ -105,20 +105,24 @@ private Expression invoke(Expression expression, String fnName) {
Class<?> componentType = parameterType.getComponentType();
Object varArgs = Array.newInstance(componentType, inputSize - fixedArgsSize);
for (int i = fixedArgsSize; i < inputSize; i++) {
if (!(expression.children().get(i) instanceof NullLiteral)) {
Array.set(varArgs, i - fixedArgsSize, expression.children().get(i));
}
Array.set(varArgs, i - fixedArgsSize, expression.children().get(i));
}
Object[] objects = new Object[fixedArgsSize + 1];
for (int i = 0; i < fixedArgsSize; i++) {
objects[i] = expression.children().get(i);
}
objects[fixedArgsSize] = varArgs;

return (Literal) method.invoke(null, varArgs);
return (Literal) method.invoke(null, objects);
}
return (Literal) method.invoke(null, expression.children().toArray());
} catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException e) {
} catch (InvocationTargetException e) {
if (e.getTargetException() instanceof NotSupportedException) {
throw new NotSupportedException(e.getTargetException().getMessage());
} else {
return expression;
}
} catch (IllegalAccessException | IllegalArgumentException e) {
return expression;
}
}
Expand Down Expand Up @@ -192,7 +196,6 @@ private void registerFunctions() {
List<Class<?>> classes = ImmutableList.of(
DateTimeAcquire.class,
DateTimeExtractAndTransform.class,
ExecutableFunctions.class,
DateLiteral.class,
DateTimeArithmetic.class,
NumericArithmetic.class,
Expand Down

This file was deleted.

Loading

0 comments on commit e06b3d3

Please sign in to comment.