Java Code Examples for org.apache.calcite.sql.SqlFunctionCategory#USER_DEFINED_FUNCTION

The following examples show how to use org.apache.calcite.sql.SqlFunctionCategory#USER_DEFINED_FUNCTION . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SqlUserDefinedFunction.java    From Bats with Apache License 2.0 5 votes vote down vote up
/** Creates a {@link SqlUserDefinedFunction}. */
public SqlUserDefinedFunction(SqlIdentifier opName,
    SqlReturnTypeInference returnTypeInference,
    SqlOperandTypeInference operandTypeInference,
    SqlOperandTypeChecker operandTypeChecker,
    List<RelDataType> paramTypes,
    Function function) {
  this(opName, returnTypeInference, operandTypeInference, operandTypeChecker,
      paramTypes, function, SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 2
Source File: SqlUserDefinedAggFunction.java    From calcite with Apache License 2.0 5 votes vote down vote up
/** Creates a SqlUserDefinedAggFunction. */
public SqlUserDefinedAggFunction(SqlIdentifier opName,
    SqlReturnTypeInference returnTypeInference,
    SqlOperandTypeInference operandTypeInference,
    SqlOperandTypeChecker operandTypeChecker, AggregateFunction function,
    boolean requiresOrder, boolean requiresOver,
    Optionality requiresGroupOrder, RelDataTypeFactory typeFactory) {
  super(Util.last(opName.names), opName, SqlKind.OTHER_FUNCTION,
      returnTypeInference, operandTypeInference, operandTypeChecker,
      SqlFunctionCategory.USER_DEFINED_FUNCTION, requiresOrder, requiresOver,
      requiresGroupOrder);
  this.function = function;
  this.typeFactory = typeFactory;
}
 
Example 3
Source File: SqlThrowExceptionFunction.java    From flink with Apache License 2.0 5 votes vote down vote up
public SqlThrowExceptionFunction(RelDataType returnType) {
	super(
		"THROW_EXCEPTION",
		SqlKind.OTHER_FUNCTION,
		opBinding -> returnType,
		null,
		OperandTypes.STRING,
		SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 4
Source File: BridgingUtils.java    From flink with Apache License 2.0 5 votes vote down vote up
static SqlFunctionCategory createSqlFunctionCategory(@Nullable FunctionIdentifier identifier) {
	if (identifier == null || identifier.getIdentifier().isPresent()) {
		return SqlFunctionCategory.USER_DEFINED_FUNCTION;
	}

	return SqlFunctionCategory.SYSTEM;
}
 
Example 5
Source File: HyperLogLog.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
public SqlNdvAggFunction() {
  super("NDV",
    null,
    SqlKind.OTHER_FUNCTION,
    ReturnTypes.BIGINT,
    null,
    OperandTypes.ANY,
    SqlFunctionCategory.USER_DEFINED_FUNCTION,
    false,
    false
  );
}
 
Example 6
Source File: HyperLogLog.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
public SqlHllMergeAggFunction() {
  super("HLL_MERGE",
    null,
    SqlKind.OTHER_FUNCTION,
    ReturnTypes.explicit(SqlTypeName.VARBINARY, HLL_VARBINARY_SIZE),
    null,
    OperandTypes.BINARY,
    SqlFunctionCategory.USER_DEFINED_FUNCTION,
    false,
    false
  );
}
 
Example 7
Source File: HyperLogLog.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
public SqlHllAggFunction() {
  super("HLL",
    null,
    SqlKind.OTHER_FUNCTION,
    ReturnTypes.explicit(SqlTypeName.VARBINARY, HLL_VARBINARY_SIZE),
    null,
    OperandTypes.ANY,
    SqlFunctionCategory.USER_DEFINED_FUNCTION,
    false,
    false
  );
}
 
Example 8
Source File: MockSqlOperatorTable.java    From calcite with Apache License 2.0 5 votes vote down vote up
public MyFunction() {
  super("MYFUN",
      new SqlIdentifier("MYFUN", SqlParserPos.ZERO),
      SqlKind.OTHER_FUNCTION,
      null,
      null,
      OperandTypes.NUMERIC,
      null,
      SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 9
Source File: MockSqlOperatorTable.java    From calcite with Apache License 2.0 5 votes vote down vote up
public RampFunction() {
  super("RAMP",
      SqlKind.OTHER_FUNCTION,
      null,
      null,
      OperandTypes.NUMERIC,
      SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 10
Source File: SqlAggOperator.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
public SqlAggOperator(String name, int argCountMin, int argCountMax, SqlReturnTypeInference sqlReturnTypeInference) {
  super(name,
      new SqlIdentifier(name, SqlParserPos.ZERO),
      SqlKind.OTHER_FUNCTION,
      sqlReturnTypeInference,
      null,
      Checker.getChecker(argCountMin, argCountMax),
      SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 11
Source File: HiveSqlAggFunction.java    From marble with Apache License 2.0 5 votes vote down vote up
protected HiveSqlAggFunction(String name, boolean requiresOrder,
    boolean requiresOver,
    SqlReturnTypeInference sqlReturnTypeInference) {
  this(name, new SqlIdentifier(name, SqlParserPos.ZERO),
      SqlKind.OTHER_FUNCTION,
      SqlFunctionCategory.USER_DEFINED_FUNCTION,
      requiresOrder, requiresOver, sqlReturnTypeInference);
}
 
Example 12
Source File: SqlThrowExceptionFunction.java    From flink with Apache License 2.0 5 votes vote down vote up
public SqlThrowExceptionFunction(RelDataType returnType) {
	super(
		"THROW_EXCEPTION",
		SqlKind.OTHER_FUNCTION,
		opBinding -> returnType,
		null,
		OperandTypes.STRING,
		SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 13
Source File: MockSqlOperatorTable.java    From calcite with Apache License 2.0 5 votes vote down vote up
public DedupFunction() {
  super("DEDUP",
      SqlKind.OTHER_FUNCTION,
      null,
      null,
      OperandTypes.VARIADIC,
      SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 14
Source File: DrillSqlOperator.java    From Bats with Apache License 2.0 5 votes vote down vote up
protected DrillSqlOperator(String name, List<DrillFuncHolder> functions, int argCountMin, int argCountMax, boolean isDeterministic,
    SqlReturnTypeInference sqlReturnTypeInference, boolean isNiladic) {
  super(new SqlIdentifier(name, SqlParserPos.ZERO),
      sqlReturnTypeInference,
      null,
      Checker.getChecker(argCountMin, argCountMax),
      null,
      SqlFunctionCategory.USER_DEFINED_FUNCTION);
  this.functions = functions;
  this.isDeterministic = isDeterministic;
  this.isNiladic = isNiladic;
}
 
Example 15
Source File: SqlUserDefinedAggFunction.java    From Bats with Apache License 2.0 5 votes vote down vote up
/** Creates a SqlUserDefinedAggFunction. */
public SqlUserDefinedAggFunction(SqlIdentifier opName,
    SqlReturnTypeInference returnTypeInference,
    SqlOperandTypeInference operandTypeInference,
    SqlOperandTypeChecker operandTypeChecker, AggregateFunction function,
    boolean requiresOrder, boolean requiresOver,
    Optionality requiresGroupOrder, RelDataTypeFactory typeFactory) {
  super(Util.last(opName.names), opName, SqlKind.OTHER_FUNCTION,
      returnTypeInference, operandTypeInference, operandTypeChecker,
      SqlFunctionCategory.USER_DEFINED_FUNCTION, requiresOrder, requiresOver,
      requiresGroupOrder);
  this.function = function;
  this.typeFactory = typeFactory;
}
 
Example 16
Source File: VarArgSqlOperator.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
public VarArgSqlOperator(String name, MajorType returnType, boolean isDeterministic) {
  super(new SqlIdentifier(name, SqlParserPos.ZERO), DynamicReturnType.INSTANCE, null, new Checker(), null, SqlFunctionCategory.USER_DEFINED_FUNCTION);
  this.returnType = returnType;
  this.isDeterministic = isDeterministic;
}
 
Example 17
Source File: MockSqlOperatorTable.java    From calcite with Apache License 2.0 4 votes vote down vote up
public SplitFunction() {
  super("SPLIT", new SqlIdentifier("SPLIT", SqlParserPos.ZERO), SqlKind.OTHER_FUNCTION, null,
      null, OperandTypes.family(SqlTypeFamily.STRING, SqlTypeFamily.STRING), null,
      SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 18
Source File: HiveSqlFunction.java    From marble with Apache License 2.0 4 votes vote down vote up
public HiveSqlFunction(String name,
    SqlReturnTypeInference returnTypeInference) {
  this(new SqlIdentifier(name, SqlParserPos.ZERO), SqlKind.OTHER_FUNCTION,
      returnTypeInference, SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 19
Source File: HiveUDFOperator.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
public HiveUDFOperator(String name, SqlReturnTypeInference sqlReturnTypeInference) {
  super(new SqlIdentifier(name, SqlParserPos.ZERO), sqlReturnTypeInference, null, ArgChecker.INSTANCE, null,
      SqlFunctionCategory.USER_DEFINED_FUNCTION);
}
 
Example 20
Source File: MockSqlOperatorTable.java    From calcite with Apache License 2.0 4 votes vote down vote up
public MyAggFunc() {
  super("myAggFunc", null, SqlKind.OTHER_FUNCTION, ReturnTypes.BIGINT, null,
      OperandTypes.ONE_OR_MORE, SqlFunctionCategory.USER_DEFINED_FUNCTION, false, false,
      Optionality.FORBIDDEN);
}