Skip to content

Commit

Permalink
add outer
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangstar333 committed Apr 18, 2024
1 parent b4c54ad commit b39b66c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion be/src/vec/columns/column_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ void ColumnArray::insert(const Field& x) {
}

void ColumnArray::insert_from(const IColumn& src_, size_t n) {
DCHECK(n < src_.size()) << n << " " << src_.size();
DCHECK_LT(n, src_.size());
const ColumnArray& src = assert_cast<const ColumnArray&>(src_);
size_t size = src.size_at(n);
size_t offset = src.offset_at(n);
Expand Down
9 changes: 9 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
Original file line number Diff line number Diff line change
Expand Up @@ -5365,6 +5365,15 @@ public void createFunction(CreateFunctionStmt stmt) throws UserException {
} else {
Database db = getInternalCatalog().getDbOrDdlException(stmt.getFunctionName().getDb());
db.addFunction(stmt.getFunction(), stmt.isIfNotExists());
if (stmt.getFunction().isUDTFunction()) {
// all of the table function in doris will have two function
// one is the noraml, and another is outer, the different of them is deal with
// empty: whether need to insert NULL result value
Function outerFunction = stmt.getFunction().clone();
FunctionName name = outerFunction.getFunctionName();
name.setFn(name.getFunction() + "_outer");
db.addFunction(outerFunction, stmt.isIfNotExists());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public Function(Function other) {
System.arraycopy(other.argTypes, 0, this.argTypes, 0, other.argTypes.length);
}
this.checksum = other.checksum;
this.isGlobal = other.isGlobal;
this.isUDTFunction = other.isUDTFunction;
}

public void setNestedFunction(Function nestedFunction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,21 @@ public static ScalarFunction createUdf(
return fn;
}

public ScalarFunction(ScalarFunction other) {
super(other);
if (other == null) {
return;
}
symbolName = other.symbolName;
prepareFnSymbol = other.prepareFnSymbol;
closeFnSymbol = other.closeFnSymbol;
}

@Override
public Function clone() {
return new ScalarFunction(this);
}

public void setSymbolName(String s) {
symbolName = s;
}
Expand Down

0 comments on commit b39b66c

Please sign in to comment.