-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add option to remove
RemoveNullColumn
operator (#536)
一个折衷
- Loading branch information
Showing
5 changed files
with
131 additions
and
68 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
51 changes: 51 additions & 0 deletions
51
...izer/src/main/java/cn/edu/tsinghua/iginx/logical/optimizer/rules/AllowNullColumnRule.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,51 @@ | ||
/* | ||
* IGinX - the polystore system with high performance | ||
* Copyright (C) Tsinghua University | ||
* TSIGinX@gmail.com | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package cn.edu.tsinghua.iginx.logical.optimizer.rules; | ||
|
||
import cn.edu.tsinghua.iginx.engine.shared.operator.RemoveNullColumn; | ||
import cn.edu.tsinghua.iginx.engine.shared.source.OperatorSource; | ||
import cn.edu.tsinghua.iginx.engine.shared.source.SourceType; | ||
import cn.edu.tsinghua.iginx.logical.optimizer.core.RuleCall; | ||
import com.google.auto.service.AutoService; | ||
|
||
@AutoService(Rule.class) | ||
public class AllowNullColumnRule extends Rule { | ||
|
||
public AllowNullColumnRule() { | ||
super( | ||
AllowNullColumnRule.class.getSimpleName(), | ||
operand(RemoveNullColumn.class, any()), | ||
Long.MAX_VALUE, | ||
RuleStrategy.FIXED_POINT); | ||
} | ||
|
||
@Override | ||
public boolean matches(RuleCall call) { | ||
RemoveNullColumn removeNullColumn = (RemoveNullColumn) call.getMatchedRoot(); | ||
return removeNullColumn.getSource().getType() == SourceType.Operator; | ||
} | ||
|
||
@Override | ||
public void onMatch(RuleCall call) { | ||
RemoveNullColumn removeNullColumn = (RemoveNullColumn) call.getMatchedRoot(); | ||
OperatorSource source = (OperatorSource) removeNullColumn.getSource(); | ||
call.transformTo(source.getOperator()); | ||
} | ||
} |
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
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