drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinfengni <...@git.apache.org>
Subject [GitHub] drill pull request: Drill 4372 review
Date Wed, 16 Mar 2016 23:42:01 GMT
Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/397#discussion_r56435067
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlOperator.java
---
    @@ -64,4 +108,47 @@ public boolean isDeterministic() {
       public List<DrillFuncHolder> getFunctions() {
         return functions;
       }
    +
    +  public static class DrillSqlOperatorBuilder {
    +    private String name;
    +    private final List<DrillFuncHolder> functions = Lists.newArrayList();
    +    private int argCountMin = Integer.MAX_VALUE;
    +    private int argCountMax = Integer.MIN_VALUE;
    +    private boolean isDeterministic = true;
    +
    +    public DrillSqlOperatorBuilder setName(final String name) {
    +      this.name = name;
    +      return this;
    +    }
    +
    +    public DrillSqlOperatorBuilder addFunctions(Collection<DrillFuncHolder> functions)
{
    +      this.functions.addAll(functions);
    +      return this;
    +    }
    +
    +    public DrillSqlOperatorBuilder setArgumentCount(final int argCountMin, final int
argCountMax) {
    +      this.argCountMin = Math.min(this.argCountMin, argCountMin);
    +      this.argCountMax = Math.max(this.argCountMax, argCountMax);
    +      return this;
    +    }
    +
    +    public DrillSqlOperatorBuilder setDeterministic(boolean isDeterministic) {
    +      if(this.isDeterministic) {
    --- End diff --
    
    why do you have this check?
    
    If someone uses this builder, setDeterminsitic(false), then setDeterministic(true). The
second call will not get the desired result.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message