Skip to content
Merged
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 @@ -1072,7 +1072,8 @@ protected String getFunctionNotFoundError(Type[] argTypes) {
* @throws AnalysisException
*/
public void analyzeImplForDefaultValue(Type type) throws AnalysisException {
fn = getBuiltinFunction(fnName.getFunction(), new Type[0], Function.CompareMode.IS_NONSTRICT_SUPERTYPE_OF);
fn = new Function(getBuiltinFunction(fnName.getFunction(), new Type[0],
Function.CompareMode.IS_NONSTRICT_SUPERTYPE_OF));
fn.setReturnType(type);
this.type = type;
for (int i = 0; i < children.size(); ++i) {
Expand Down
20 changes: 20 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/catalog/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,26 @@ public Function(long id, FunctionName name, List<Type> argTypes, Type retType,
this(id, name, argTypes, retType, hasVarArgs, TFunctionBinaryType.BUILTIN, true, vectorized, mode);
}

public Function(Function other) {
if (other == null) {
return;
}
this.id = other.id;
this.name = new FunctionName(other.name.getDb(), other.name.getFunction());
this.hasVarArgs = other.hasVarArgs;
this.retType = other.retType;
this.userVisible = other.userVisible;
this.nullableMode = other.nullableMode;
this.vectorized = other.vectorized;
this.binaryType = other.binaryType;
this.location = other.location;
if (other.argTypes != null) {
this.argTypes = new Type[other.argTypes.length];
System.arraycopy(other.argTypes, 0, this.argTypes, 0, other.argTypes.length);
}
this.checksum = other.checksum;
}

public FunctionName getFunctionName() {
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ suite("test_current_timestamp") {
qt_insert_into """ select count(*) from ${tableName} where to_date(dt_4) = to_date(dt_5); """
qt_insert_into """ select count(*) from ${tableName} where to_date(dt_6) = to_date(dt_7); """

sql """select now()"""

// test stream load.
streamLoad {
table "${tableName}"
Expand All @@ -64,4 +66,6 @@ suite("test_current_timestamp") {
qt_stream_load """ select count(*) from ${tableName} where id > 4 and to_date(dt_2) = to_date(dt_3); """
qt_stream_load """ select count(*) from ${tableName} where id > 4 and to_date(dt_4) = to_date(dt_5); """
qt_stream_load """ select count(*) from ${tableName} where id > 4 and to_date(dt_6) = to_date(dt_7); """

sql """select now()"""
}