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

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

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

origin: apache/hive

private static CalciteUDFInfo getUDFInfo(String hiveUdfName,
  ImmutableList<RelDataType> calciteArgTypes, RelDataType calciteRetType) {
 CalciteUDFInfo udfInfo = new CalciteUDFInfo();
 udfInfo.udfName = hiveUdfName;
 udfInfo.returnTypeInference = ReturnTypes.explicit(calciteRetType);
 udfInfo.operandTypeInference = InferTypes.explicit(calciteArgTypes);
 ImmutableList.Builder<SqlTypeFamily> typeFamilyBuilder = new ImmutableList.Builder<SqlTypeFamily>();
 for (RelDataType at : calciteArgTypes) {
  typeFamilyBuilder.add(Util.first(at.getSqlTypeName().getFamily(), SqlTypeFamily.ANY));
 }
 udfInfo.operandTypeChecker = OperandTypes.family(typeFamilyBuilder.build());
 return udfInfo;
}
origin: apache/kylin

SqlAggFunction createCustomAggFunction(String funcName, RelDataType returnType, Class<?> customAggFuncClz) {
  RelDataTypeFactory typeFactory = getCluster().getTypeFactory();
  SqlIdentifier sqlIdentifier = new SqlIdentifier(funcName, new SqlParserPos(1, 1));
  AggregateFunction aggFunction = AggregateFunctionImpl.create(customAggFuncClz);
  List<RelDataType> argTypes = new ArrayList<RelDataType>();
  List<SqlTypeFamily> typeFamilies = new ArrayList<SqlTypeFamily>();
  for (FunctionParameter o : aggFunction.getParameters()) {
    final RelDataType type = o.getType(typeFactory);
    argTypes.add(type);
    typeFamilies.add(Util.first(type.getSqlTypeName().getFamily(), SqlTypeFamily.ANY));
  }
  return new SqlUserDefinedAggFunction(sqlIdentifier, ReturnTypes.explicit(returnType),
      InferTypes.explicit(argTypes), OperandTypes.family(typeFamilies), aggFunction, false, false,
      typeFactory);
}
origin: apache/drill

private static CalciteUDFInfo getUDFInfo(String hiveUdfName,
  ImmutableList<RelDataType> calciteArgTypes, RelDataType calciteRetType) {
 CalciteUDFInfo udfInfo = new CalciteUDFInfo();
 udfInfo.udfName = hiveUdfName;
 udfInfo.returnTypeInference = ReturnTypes.explicit(calciteRetType);
 udfInfo.operandTypeInference = InferTypes.explicit(calciteArgTypes);
 ImmutableList.Builder<SqlTypeFamily> typeFamilyBuilder = new ImmutableList.Builder<SqlTypeFamily>();
 for (RelDataType at : calciteArgTypes) {
  typeFamilyBuilder.add(Util.first(at.getSqlTypeName().getFamily(), SqlTypeFamily.ANY));
 }
 udfInfo.operandTypeChecker = OperandTypes.family(typeFamilyBuilder.build());
 return udfInfo;
}
origin: apache/hive

oldCall.isDistinct(),
ReturnTypes.explicit(sumSquaredReturnType),
InferTypes.explicit(Collections.singletonList(argSquared.getType())),
oldCall.isDistinct(),
ReturnTypes.explicit(sumReturnType),
InferTypes.explicit(Collections.singletonList(argOrdinalType)),
origin: Qihoo360/Quicksql

if (function instanceof ScalarFunction) {
 return new SqlUserDefinedFunction(name, infer((ScalarFunction) function),
   InferTypes.explicit(argTypes), typeChecker, paramTypes, function);
} else if (function instanceof AggregateFunction) {
 return new SqlUserDefinedAggFunction(name,
   infer((AggregateFunction) function), InferTypes.explicit(argTypes),
   typeChecker, (AggregateFunction) function, false, false, typeFactory);
} else if (function instanceof TableMacro) {
 return new SqlUserDefinedTableMacro(name, ReturnTypes.CURSOR,
   InferTypes.explicit(argTypes), typeChecker, paramTypes,
   (TableMacro) function);
} else if (function instanceof TableFunction) {
 return new SqlUserDefinedTableFunction(name, ReturnTypes.CURSOR,
   InferTypes.explicit(argTypes), typeChecker, paramTypes,
   (TableFunction) function);
} else {
origin: org.apache.calcite/calcite-core

if (function instanceof ScalarFunction) {
 return new SqlUserDefinedFunction(name, infer((ScalarFunction) function),
   InferTypes.explicit(argTypes), typeChecker, paramTypes, function);
} else if (function instanceof AggregateFunction) {
 return new SqlUserDefinedAggFunction(name,
   infer((AggregateFunction) function), InferTypes.explicit(argTypes),
   typeChecker, (AggregateFunction) function, false, false,
   Optionality.FORBIDDEN, typeFactory);
} else if (function instanceof TableMacro) {
 return new SqlUserDefinedTableMacro(name, ReturnTypes.CURSOR,
   InferTypes.explicit(argTypes), typeChecker, paramTypes,
   (TableMacro) function);
} else if (function instanceof TableFunction) {
 return new SqlUserDefinedTableFunction(name, ReturnTypes.CURSOR,
   InferTypes.explicit(argTypes), typeChecker, paramTypes,
   (TableFunction) function);
} else {
origin: dremio/dremio-oss

if (function instanceof ScalarFunction) {
 return new SqlUserDefinedFunction(name, infer((ScalarFunction) function),
   InferTypes.explicit(argTypes), typeChecker, paramTypes, function);
} else if (function instanceof AggregateFunction) {
 return new SqlUserDefinedAggFunction(name,
   infer((AggregateFunction) function), InferTypes.explicit(argTypes),
   typeChecker, (AggregateFunction) function, false, false, typeFactory);
} else if (function instanceof TableMacro) {
 return new SqlUserDefinedTableMacro(name, ReturnTypes.CURSOR,
   InferTypes.explicit(argTypes), typeChecker, paramTypes,
   (TableMacro) function);
} else if (function instanceof TableFunction) {
 return new SqlUserDefinedTableFunction(name, ReturnTypes.CURSOR,
   InferTypes.explicit(argTypes), typeChecker, paramTypes,
   (TableFunction) function);
} else {
origin: org.apache.kylin/kylin-query

SqlAggFunction createCustomAggFunction(String funcName, RelDataType returnType, Class<?> customAggFuncClz) {
  RelDataTypeFactory typeFactory = getCluster().getTypeFactory();
  SqlIdentifier sqlIdentifier = new SqlIdentifier(funcName, new SqlParserPos(1, 1));
  AggregateFunction aggFunction = AggregateFunctionImpl.create(customAggFuncClz);
  List<RelDataType> argTypes = new ArrayList<RelDataType>();
  List<SqlTypeFamily> typeFamilies = new ArrayList<SqlTypeFamily>();
  for (FunctionParameter o : aggFunction.getParameters()) {
    final RelDataType type = o.getType(typeFactory);
    argTypes.add(type);
    typeFamilies.add(Util.first(type.getSqlTypeName().getFamily(), SqlTypeFamily.ANY));
  }
  return new SqlUserDefinedAggFunction(sqlIdentifier, ReturnTypes.explicit(returnType),
      InferTypes.explicit(argTypes), OperandTypes.family(typeFamilies), aggFunction, false, false,
      typeFactory);
}
origin: com.facebook.presto.hive/hive-apache

private static CalciteUDFInfo getUDFInfo(String hiveUdfName,
  ImmutableList<RelDataType> calciteArgTypes, RelDataType calciteRetType) {
 CalciteUDFInfo udfInfo = new CalciteUDFInfo();
 udfInfo.udfName = hiveUdfName;
 udfInfo.returnTypeInference = ReturnTypes.explicit(calciteRetType);
 udfInfo.operandTypeInference = InferTypes.explicit(calciteArgTypes);
 ImmutableList.Builder<SqlTypeFamily> typeFamilyBuilder = new ImmutableList.Builder<SqlTypeFamily>();
 for (RelDataType at : calciteArgTypes) {
  typeFamilyBuilder.add(Util.first(at.getSqlTypeName().getFamily(), SqlTypeFamily.ANY));
 }
 udfInfo.operandTypeChecker = OperandTypes.family(typeFamilyBuilder.build());
 udfInfo.argTypes = ImmutableList.<RelDataType> copyOf(calciteArgTypes);
 udfInfo.retType = calciteRetType;
 return udfInfo;
}
org.apache.calcite.sql.typeInferTypes

Javadoc

Strategies for inferring operand types.

Most used methods

  • explicit
    Returns an SqlOperandTypeInference that returns a given list of types.

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • JList (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • 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