drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudheeshkatkam <...@git.apache.org>
Subject [GitHub] drill pull request: Drill 4372 for review
Date Sat, 20 Feb 2016 00:41:23 GMT
Github user sudheeshkatkam commented on a diff in the pull request:

    https://github.com/apache/drill/pull/377#discussion_r53538428
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillCalciteSqlOperatorWrapper.java
---
    @@ -0,0 +1,187 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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 org.apache.drill.exec.planner.sql;
    +
    +import org.apache.calcite.rel.type.RelDataType;
    +import org.apache.calcite.sql.SqlCall;
    +import org.apache.calcite.sql.SqlCallBinding;
    +import org.apache.calcite.sql.SqlLiteral;
    +import org.apache.calcite.sql.SqlNode;
    +import org.apache.calcite.sql.SqlOperandCountRange;
    +import org.apache.calcite.sql.SqlOperator;
    +import org.apache.calcite.sql.SqlOperatorBinding;
    +import org.apache.calcite.sql.SqlSyntax;
    +import org.apache.calcite.sql.SqlWriter;
    +import org.apache.calcite.sql.parser.SqlParserPos;
    +import org.apache.calcite.sql.type.SqlOperandTypeChecker;
    +import org.apache.calcite.sql.type.SqlOperandTypeInference;
    +import org.apache.calcite.sql.type.SqlReturnTypeInference;
    +import org.apache.calcite.sql.validate.SqlMonotonicity;
    +import org.apache.calcite.sql.validate.SqlValidator;
    +import org.apache.calcite.sql.validate.SqlValidatorScope;
    +
    +public class DrillCalciteSqlOperatorWrapper extends SqlOperator implements DrillCalciteSqlWrapper
{
    +  public final SqlOperator operator;
    +  private SqlOperandTypeChecker operandTypeChecker = new Checker();
    +
    +  public DrillCalciteSqlOperatorWrapper(SqlOperator operator) {
    +    super(
    +        operator.getName(),
    +        operator.getKind(),
    +        operator.getLeftPrec(),
    +        operator.getRightPrec(),
    +        operator.getReturnTypeInference(),
    +        operator.getOperandTypeInference(),
    +        operator.getOperandTypeChecker());
    +    this.operator = operator;
    +  }
    +
    +  @Override
    +  public SqlOperator getOperator() {
    +    return operator;
    +  }
    +
    +  @Override
    +  public SqlOperandTypeChecker getOperandTypeChecker() {
    +    return operandTypeChecker;
    +  }
    +
    +  @Override
    +  public SqlOperandCountRange getOperandCountRange() {
    +    return operandTypeChecker.getOperandCountRange();
    +  }
    +
    +  @Override
    +  public SqlSyntax getSyntax() {
    +    return operator.getSyntax();
    +  }
    +
    +  @Override
    +  public SqlCall createCall(
    +      SqlLiteral functionQualifier,
    +      SqlParserPos pos,
    +      SqlNode... operands) {
    +    return operator.createCall(functionQualifier, pos, operands);
    +  }
    +
    +  @Override
    +  public SqlNode rewriteCall(SqlValidator validator, SqlCall call) {
    +    return operator.rewriteCall(validator, call);
    +  }
    +
    +  @Override
    +  public RelDataType inferReturnType(SqlOperatorBinding opBinding) {
    +    return operator.inferReturnType(opBinding);
    +  }
    +
    +  @Override
    +  public RelDataType deriveType(
    +      SqlValidator validator,
    +      SqlValidatorScope scope,
    +      SqlCall call) {
    +    return operator.deriveType(validator,
    +        scope,
    +        call);
    +  }
    +
    +  @Override
    +  public boolean checkOperandTypes(
    +      SqlCallBinding callBinding,
    +      boolean throwOnFailure) {
    +    return true;
    --- End diff --
    
    doc


---
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