congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SqlReturnTypeInference
Code IndexAdd Tabnine to your IDE (free)

How to use
SqlReturnTypeInference
in
org.apache.calcite.sql.type

Best Java code snippets using org.apache.calcite.sql.type.SqlReturnTypeInference (Showing top 10 results out of 315)

origin: org.apache.calcite/calcite-core

 public RelDataType inferReturnType(SqlOperatorBinding opBinding) {
  for (SqlReturnTypeInference rule : rules) {
   RelDataType ret = rule.inferReturnType(opBinding);
   if (ret != null) {
    return ret;
   }
  }
  return null;
 }
}
origin: Qihoo360/Quicksql

 public RelDataType inferReturnType(SqlOperatorBinding opBinding) {
  for (SqlReturnTypeInference rule : rules) {
   RelDataType ret = rule.inferReturnType(opBinding);
   if (ret != null) {
    return ret;
   }
  }
  return null;
 }
}
origin: Qihoo360/Quicksql

 public RelDataType inferReturnType(
   SqlOperatorBinding opBinding) {
  RelDataType ret = rule.inferReturnType(opBinding);
  if (ret == null) {
   // inferReturnType may return null; transformType does not accept or
   // return null types
   return null;
  }
  for (SqlTypeTransform transform : transforms) {
   ret = transform.transformType(opBinding, ret);
  }
  return ret;
 }
}
origin: org.apache.calcite/calcite-core

 public RelDataType inferReturnType(
   SqlOperatorBinding opBinding) {
  RelDataType ret = rule.inferReturnType(opBinding);
  if (ret == null) {
   // inferReturnType may return null; transformType does not accept or
   // return null types
   return null;
  }
  for (SqlTypeTransform transform : transforms) {
   ret = transform.transformType(opBinding, ret);
  }
  return ret;
 }
}
origin: Qihoo360/Quicksql

/**
 * Infers the return type of an invocation of this operator; only called
 * after the number and types of operands have already been validated.
 * Subclasses must either override this method or supply an instance of
 * {@link SqlReturnTypeInference} to the constructor.
 *
 * @param opBinding description of invocation (not necessarily a
 * {@link SqlCall})
 * @return inferred return type
 */
public RelDataType inferReturnType(
  SqlOperatorBinding opBinding) {
 if (returnTypeInference != null) {
  return returnTypeInference.inferReturnType(opBinding);
 }
 // Derived type should have overridden this method, since it didn't
 // supply a type inference rule.
 throw Util.needToImplement(this);
}
origin: org.apache.calcite/calcite-core

/**
 * Infers the return type of an invocation of this operator; only called
 * after the number and types of operands have already been validated.
 * Subclasses must either override this method or supply an instance of
 * {@link SqlReturnTypeInference} to the constructor.
 *
 * @param opBinding description of invocation (not necessarily a
 * {@link SqlCall})
 * @return inferred return type
 */
public RelDataType inferReturnType(
  SqlOperatorBinding opBinding) {
 if (returnTypeInference != null) {
  RelDataType returnType = returnTypeInference.inferReturnType(opBinding);
  if (returnType == null) {
   throw new IllegalArgumentException("Cannot infer return type for "
     + opBinding.getOperator() + "; operand types: "
     + opBinding.collectOperandTypes());
  }
  return returnType;
 }
 // Derived type should have overridden this method, since it didn't
 // supply a type inference rule.
 throw Util.needToImplement(this);
}
origin: Qihoo360/Quicksql

public RelDataType inferReturnType(
  SqlOperatorBinding opBinding) {
 SqlCallBinding callBinding = (SqlCallBinding) opBinding;
 ExplicitOperatorBinding newOpBinding =
   new ExplicitOperatorBinding(
     opBinding,
     collectOperandTypes(
       callBinding.getValidator(),
       callBinding.getScope(),
       callBinding.getCall()));
 return ReturnTypes.BOOLEAN_NULLABLE.inferReturnType(
   newOpBinding);
}
origin: org.apache.calcite/calcite-core

public RelDataType inferReturnType(
  SqlOperatorBinding opBinding) {
 SqlCallBinding callBinding = (SqlCallBinding) opBinding;
 ExplicitOperatorBinding newOpBinding =
   new ExplicitOperatorBinding(
     opBinding,
     collectOperandTypes(
       callBinding.getValidator(),
       callBinding.getScope(),
       callBinding.getCall()));
 return ReturnTypes.BOOLEAN_NULLABLE.inferReturnType(
   newOpBinding);
}
origin: org.apache.drill.exec/drill-java-exec

  TypeInferenceUtils.getDrillSqlReturnTypeInference(SqlKind.SUM.name(),
    ImmutableList.of())
   .inferReturnType(oldCall.createBinding(oldAggRel));
sumType = typeFactory.createTypeWithNullability(sumType, true);
final AggregateCall sumArgSquaredAggCall =
origin: org.apache.drill.exec/drill-java-exec

  TypeInferenceUtils.getDrillSqlReturnTypeInference(SqlKind.SUM.name(),
    ImmutableList.of())
   .inferReturnType(oldCall.createBinding(oldAggRel));
sumType =
  typeFactory.createTypeWithNullability(
org.apache.calcite.sql.typeSqlReturnTypeInference

Javadoc

Strategy interface to infer the type of an operator call from the type of the operands.

This interface is an example of the org.apache.calcite.util.Glossary#STRATEGY_PATTERN. This makes sense because many operators have similar, straightforward strategies, such as to take the type of the first operand.

Most used methods

  • inferReturnType
    Infers the return type of a call to an SqlOperator.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now