-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QL: Refactor FunctionRegistry to make it pluggable (#67761)
Break the FunctionRegistry monolith into a common QL base and a SQL specific registry that handles aspects such as distinct and extract. In the process clean-up the names and signature of internal interfaces. Most of the semantics were preserved however the error messages were slightly tweaked to make them more readable - this shouldn't be a problem as they are being used internally mainly in test assertions.
- Loading branch information
Showing
9 changed files
with
448 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
454 changes: 160 additions & 294 deletions
454
...gin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/function/FunctionRegistry.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
.../src/main/java/org/elasticsearch/xpack/sql/expression/function/SqlFunctionDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.sql.expression.function; | ||
|
||
import org.elasticsearch.xpack.ql.expression.function.Function; | ||
import org.elasticsearch.xpack.ql.expression.function.FunctionDefinition; | ||
|
||
import java.util.List; | ||
|
||
public class SqlFunctionDefinition extends FunctionDefinition { | ||
|
||
/** | ||
* Is this a datetime function compatible with {@code EXTRACT}. | ||
*/ | ||
private final boolean extractViable; | ||
|
||
protected SqlFunctionDefinition(String name, | ||
List<String> aliases, | ||
Class<? extends Function> clazz, | ||
boolean dateTime, | ||
Builder builder) { | ||
super(name, aliases, clazz, builder); | ||
this.extractViable = dateTime; | ||
} | ||
|
||
/** | ||
* Is this a datetime function compatible with {@code EXTRACT}. | ||
*/ | ||
public boolean extractViable() { | ||
return extractViable; | ||
} | ||
|
||
@Override | ||
protected Builder builder() { | ||
return super.builder(); | ||
} | ||
} |
Oops, something went wrong.