Java Code Examples for org.apache.calcite.sql.SqlUtil#getAliasedSignature()

The following examples show how to use org.apache.calcite.sql.SqlUtil#getAliasedSignature() . 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: SameOperandTypeChecker.java    From Bats with Apache License 2.0 5 votes vote down vote up
public String getAllowedSignatures(SqlOperator op, String opName) {
  final String typeName = getTypeName();
  return SqlUtil.getAliasedSignature(op, opName,
      nOperands == -1
          ? ImmutableList.of(typeName, typeName, "...")
          : Collections.nCopies(nOperands, typeName));
}
 
Example 2
Source File: SameOperandTypeExceptLastOperandChecker.java    From Bats with Apache License 2.0 5 votes vote down vote up
public String getAllowedSignatures(SqlOperator op, String opName) {
  final String typeName = getTypeName();
  if (nOperands == -1) {
    return SqlUtil.getAliasedSignature(op, opName,
        ImmutableList.of(typeName, typeName, "..."));
  } else {
    List<String> types = Collections.nCopies(nOperands - 1, typeName);
    types.add(lastOperandTypeName);
    return SqlUtil.getAliasedSignature(op, opName, types);
  }
}
 
Example 3
Source File: NumericExceptFirstOperandChecker.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public String getAllowedSignatures(SqlOperator op, String opName) {
	final String anyType = "ANY_TYPE";
	final String numericType = "NUMERIC_TYPE";

	if (nOperands == -1) {
		return SqlUtil.getAliasedSignature(op, opName,
			Arrays.asList(anyType, numericType, "..."));
	} else {
		List<String> types = new ArrayList<>();
		types.add(anyType);
		types.addAll(Collections.nCopies(nOperands - 1, numericType));
		return SqlUtil.getAliasedSignature(op, opName, types);
	}
}
 
Example 4
Source File: NumericExceptFirstOperandChecker.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public String getAllowedSignatures(SqlOperator op, String opName) {
	final String anyType = "ANY_TYPE";
	final String numericType = "NUMERIC_TYPE";

	if (nOperands == -1) {
		return SqlUtil.getAliasedSignature(op, opName,
			Arrays.asList(anyType, numericType, "..."));
	} else {
		List<String> types = new ArrayList<>();
		types.add(anyType);
		types.addAll(Collections.nCopies(nOperands - 1, numericType));
		return SqlUtil.getAliasedSignature(op, opName, types);
	}
}
 
Example 5
Source File: SameOperandTypeChecker.java    From calcite with Apache License 2.0 5 votes vote down vote up
public String getAllowedSignatures(SqlOperator op, String opName) {
  final String typeName = getTypeName();
  return SqlUtil.getAliasedSignature(op, opName,
      nOperands == -1
          ? ImmutableList.of(typeName, typeName, "...")
          : Collections.nCopies(nOperands, typeName));
}
 
Example 6
Source File: SameOperandTypeExceptLastOperandChecker.java    From calcite with Apache License 2.0 5 votes vote down vote up
public String getAllowedSignatures(SqlOperator op, String opName) {
  final String typeName = getTypeName();
  if (nOperands == -1) {
    return SqlUtil.getAliasedSignature(op, opName,
        ImmutableList.of(typeName, typeName, "..."));
  } else {
    List<String> types = Collections.nCopies(nOperands - 1, typeName);
    types.add(lastOperandTypeName);
    return SqlUtil.getAliasedSignature(op, opName, types);
  }
}
 
Example 7
Source File: OperandTypes.java    From Bats with Apache License 2.0 4 votes vote down vote up
public String getAllowedSignatures(SqlOperator op, String opName) {
  return SqlUtil.getAliasedSignature(op, opName,
      ImmutableList.of("PERIOD (DATETIME, INTERVAL)",
          "PERIOD (DATETIME, DATETIME)"));
}
 
Example 8
Source File: FamilyOperandTypeChecker.java    From Bats with Apache License 2.0 4 votes vote down vote up
public String getAllowedSignatures(SqlOperator op, String opName) {
  return SqlUtil.getAliasedSignature(op, opName, families);
}
 
Example 9
Source File: RepeatFamilyOperandTypeChecker.java    From flink with Apache License 2.0 4 votes vote down vote up
public String getAllowedSignatures(SqlOperator op, String opName) {
	return SqlUtil.getAliasedSignature(op, opName, Arrays.asList(family.toString(), "..."));
}
 
Example 10
Source File: OperandTypes.java    From calcite with Apache License 2.0 4 votes vote down vote up
public String getAllowedSignatures(SqlOperator op, String opName) {
  return SqlUtil.getAliasedSignature(op, opName,
      ImmutableList.of("PERIOD (DATETIME, INTERVAL)",
          "PERIOD (DATETIME, DATETIME)"));
}
 
Example 11
Source File: FamilyOperandTypeChecker.java    From calcite with Apache License 2.0 4 votes vote down vote up
public String getAllowedSignatures(SqlOperator op, String opName) {
  return SqlUtil.getAliasedSignature(op, opName, families);
}