-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary OperatorFactories interface
- Loading branch information
1 parent
ec8e763
commit e146c8b
Showing
18 changed files
with
215 additions
and
347 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
core/trino-main/src/main/java/io/trino/operator/JoinOperatorType.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,82 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.trino.operator; | ||
|
||
import io.trino.operator.join.LookupJoinOperatorFactory; | ||
import io.trino.sql.planner.plan.JoinNode; | ||
|
||
import static io.trino.operator.join.LookupJoinOperatorFactory.JoinType.FULL_OUTER; | ||
import static io.trino.operator.join.LookupJoinOperatorFactory.JoinType.INNER; | ||
import static io.trino.operator.join.LookupJoinOperatorFactory.JoinType.LOOKUP_OUTER; | ||
import static io.trino.operator.join.LookupJoinOperatorFactory.JoinType.PROBE_OUTER; | ||
import static java.util.Objects.requireNonNull; | ||
|
||
public class JoinOperatorType | ||
{ | ||
private final LookupJoinOperatorFactory.JoinType type; | ||
private final boolean outputSingleMatch; | ||
private final boolean waitForBuild; | ||
|
||
public static JoinOperatorType ofJoinNodeType(JoinNode.Type joinNodeType, boolean outputSingleMatch, boolean waitForBuild) | ||
{ | ||
return switch (joinNodeType) { | ||
case INNER -> innerJoin(outputSingleMatch, waitForBuild); | ||
case LEFT -> probeOuterJoin(outputSingleMatch); | ||
case RIGHT -> lookupOuterJoin(waitForBuild); | ||
case FULL -> fullOuterJoin(); | ||
}; | ||
} | ||
|
||
public static JoinOperatorType innerJoin(boolean outputSingleMatch, boolean waitForBuild) | ||
{ | ||
return new JoinOperatorType(INNER, outputSingleMatch, waitForBuild); | ||
} | ||
|
||
public static JoinOperatorType probeOuterJoin(boolean outputSingleMatch) | ||
{ | ||
return new JoinOperatorType(PROBE_OUTER, outputSingleMatch, false); | ||
} | ||
|
||
public static JoinOperatorType lookupOuterJoin(boolean waitForBuild) | ||
{ | ||
return new JoinOperatorType(LOOKUP_OUTER, false, waitForBuild); | ||
} | ||
|
||
public static JoinOperatorType fullOuterJoin() | ||
{ | ||
return new JoinOperatorType(FULL_OUTER, false, false); | ||
} | ||
|
||
private JoinOperatorType(LookupJoinOperatorFactory.JoinType type, boolean outputSingleMatch, boolean waitForBuild) | ||
{ | ||
this.type = requireNonNull(type, "type is null"); | ||
this.outputSingleMatch = outputSingleMatch; | ||
this.waitForBuild = waitForBuild; | ||
} | ||
|
||
public boolean isOutputSingleMatch() | ||
{ | ||
return outputSingleMatch; | ||
} | ||
|
||
public boolean isWaitForBuild() | ||
{ | ||
return waitForBuild; | ||
} | ||
|
||
public LookupJoinOperatorFactory.JoinType getType() | ||
{ | ||
return type; | ||
} | ||
} |
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
111 changes: 0 additions & 111 deletions
111
core/trino-main/src/main/java/io/trino/operator/TrinoOperatorFactories.java
This file was deleted.
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
Oops, something went wrong.