diff --git a/be/src/exprs/cast_functions.cpp b/be/src/exprs/cast_functions.cpp index d4f842637f..d6a77fbef3 100644 --- a/be/src/exprs/cast_functions.cpp +++ b/be/src/exprs/cast_functions.cpp @@ -176,7 +176,6 @@ StringVal CastFunctions::cast_to_string_val(FunctionContext* ctx, const LargeInt sv.len = snprintf(reinterpret_cast(sv.ptr), sv.len, format, val.val); \ DCHECK_GT(sv.len, 0); \ DCHECK_LE(sv.len, MAX_FLOAT_CHARS); \ - AnyValUtil::TruncateIfNecessary(ctx->get_return_type(), &sv); \ return sv; \ } diff --git a/be/src/runtime/result_sink.cpp b/be/src/runtime/result_sink.cpp index b6980ee0a9..2051256f8b 100644 --- a/be/src/runtime/result_sink.cpp +++ b/be/src/runtime/result_sink.cpp @@ -86,7 +86,7 @@ Status ResultSink::close(RuntimeState* state, Status exec_status) { if (_sender) { _sender->close(exec_status); } - state->exec_env()->result_mgr()->cancel_at_time(time(NULL) + 5, state->fragment_instance_id()); + state->exec_env()->result_mgr()->cancel_at_time(time(NULL) + 32, state->fragment_instance_id()); Expr::close(_output_expr_ctxs, state); _closed = true; diff --git a/bin/stop_be.sh b/bin/stop_be.sh index afec60e029..a6ab853d20 100755 --- a/bin/stop_be.sh +++ b/bin/stop_be.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash - # Copyright (c) 2017, Baidu.com, Inc. All Rights Reserved # Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,10 +38,7 @@ if [ -f $pidfile ]; then exit 1 fi - if flock -nx $pidfile -c "ls > /dev/null 2>&1"; then - echo "Backend already exit, remove pid file. " - rm $pidfile - else + if kill -0 $pid; then if kill -9 $pid > /dev/null 2>&1; then echo "stop $pidcomm, and remove pid file. " rm $pidfile @@ -50,9 +46,11 @@ if [ -f $pidfile ]; then else exit 1 fi + else + echo "Backend already exit, remove pid file. " + rm $pidfile fi else echo "$pidfile does not exist" exit 1 fi - diff --git a/fe/src/com/baidu/palo/analysis/Expr.java b/fe/src/com/baidu/palo/analysis/Expr.java index 1824c808d7..a1ec5695e3 100644 --- a/fe/src/com/baidu/palo/analysis/Expr.java +++ b/fe/src/com/baidu/palo/analysis/Expr.java @@ -1141,16 +1141,23 @@ abstract public class Expr extends TreeNode implements ParseNode, Cloneabl * failure to convert a string literal to a date literal */ public final Expr castTo(Type targetType) throws AnalysisException { + final Type type = Type.getAssignmentCompatibleType(this.type, targetType, false); + if (!type.isValid()) { + throw new AnalysisException("can't cast " + this.type + " to " + targetType); + } // If the targetType is NULL_TYPE then ignore the cast because NULL_TYPE // is compatible with all types and no cast is necessary. if (targetType.isNull()) { return this; } - - if ((targetType.isStringType() || targetType.isHllType()) - && (this.type.isStringType() || this.type.isHllType())) { - return this; + if (!targetType.isDecimal()) { + // requested cast must be to assignment-compatible type + // (which implies no loss of precision) + if (!targetType.equals(type)) { + throw new AnalysisException("can't cast " + this.type + " to " + targetType); + } } + // Preconditions.checkState(PrimitiveType.isImplicitCast(type, targetType), "cast %s to %s", this.type, targetType); // TODO(zc): use implicit cast Preconditions.checkState(Type.canCastTo(this.type, targetType), "cast %s to %s", this.type, targetType); diff --git a/fe/src/com/baidu/palo/mysql/MysqlChannel.java b/fe/src/com/baidu/palo/mysql/MysqlChannel.java index f61d7b2efb..2ef2457153 100644 --- a/fe/src/com/baidu/palo/mysql/MysqlChannel.java +++ b/fe/src/com/baidu/palo/mysql/MysqlChannel.java @@ -72,8 +72,6 @@ public class MysqlChannel { } catch (Exception e) { LOG.warn("get remote host string failed: " + e.toString()); } - } else { - LOG.warn("get remote host string failed: " + "channel is null."); } } diff --git a/thirdparty/java-libraries/jprotobuf-rpc-core-3.5.14.jar b/thirdparty/java-libraries/jprotobuf-rpc-core-3.5.15.jar similarity index 71% rename from thirdparty/java-libraries/jprotobuf-rpc-core-3.5.14.jar rename to thirdparty/java-libraries/jprotobuf-rpc-core-3.5.15.jar index 10398ed136..6e7aad20a3 100644 Binary files a/thirdparty/java-libraries/jprotobuf-rpc-core-3.5.14.jar and b/thirdparty/java-libraries/jprotobuf-rpc-core-3.5.15.jar differ