Java Code Examples for org.apache.calcite.sql.type.ReturnTypes#VARCHAR_2000

The following examples show how to use org.apache.calcite.sql.type.ReturnTypes#VARCHAR_2000 . 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: SqlJsonArrayAggAggFunction.java    From Bats with Apache License 2.0 5 votes vote down vote up
public SqlJsonArrayAggAggFunction(SqlKind kind,
    SqlJsonConstructorNullClause nullClause) {
  super(kind + "_" + nullClause.name(), null, kind, ReturnTypes.VARCHAR_2000, null,
      OperandTypes.family(SqlTypeFamily.ANY), SqlFunctionCategory.SYSTEM,
      false, false, Optionality.OPTIONAL);
  this.nullClause = Objects.requireNonNull(nullClause);
}
 
Example 2
Source File: SqlJsonObjectAggAggFunction.java    From Bats with Apache License 2.0 5 votes vote down vote up
/** Creates a SqlJsonObjectAggAggFunction. */
public SqlJsonObjectAggAggFunction(SqlKind kind,
    SqlJsonConstructorNullClause nullClause) {
  super(kind + "_" + nullClause.name(), null, kind, ReturnTypes.VARCHAR_2000, null,
      OperandTypes.family(SqlTypeFamily.CHARACTER, SqlTypeFamily.ANY),
      SqlFunctionCategory.SYSTEM, false, false, Optionality.FORBIDDEN);
  this.nullClause = Objects.requireNonNull(nullClause);
}
 
Example 3
Source File: SqlJsonPrettyFunction.java    From Bats with Apache License 2.0 5 votes vote down vote up
public SqlJsonPrettyFunction() {
  super("JSON_PRETTY",
      SqlKind.OTHER_FUNCTION,
      ReturnTypes.VARCHAR_2000,
      null,
      OperandTypes.ANY,
      SqlFunctionCategory.SYSTEM);
}
 
Example 4
Source File: SqlJsonArrayAggAggFunction.java    From calcite with Apache License 2.0 5 votes vote down vote up
public SqlJsonArrayAggAggFunction(SqlKind kind,
    SqlJsonConstructorNullClause nullClause) {
  super(kind + "_" + nullClause.name(), null, kind, ReturnTypes.VARCHAR_2000,
      InferTypes.ANY_NULLABLE, OperandTypes.family(SqlTypeFamily.ANY),
      SqlFunctionCategory.SYSTEM, false, false, Optionality.OPTIONAL);
  this.nullClause = Objects.requireNonNull(nullClause);
}
 
Example 5
Source File: SqlJsonObjectAggAggFunction.java    From calcite with Apache License 2.0 5 votes vote down vote up
/** Creates a SqlJsonObjectAggAggFunction. */
public SqlJsonObjectAggAggFunction(SqlKind kind,
    SqlJsonConstructorNullClause nullClause) {
  super(kind + "_" + nullClause.name(), null, kind, ReturnTypes.VARCHAR_2000,
      (callBinding, returnType, operandTypes) -> {
        RelDataTypeFactory typeFactory = callBinding.getTypeFactory();
        operandTypes[0] = typeFactory.createSqlType(SqlTypeName.VARCHAR);
        operandTypes[1] = typeFactory.createTypeWithNullability(
            typeFactory.createSqlType(SqlTypeName.ANY), true);
      }, OperandTypes.family(SqlTypeFamily.CHARACTER,
          SqlTypeFamily.ANY),
      SqlFunctionCategory.SYSTEM, false, false, Optionality.FORBIDDEN);
  this.nullClause = Objects.requireNonNull(nullClause);
}
 
Example 6
Source File: SqlJsonObjectFunction.java    From calcite with Apache License 2.0 5 votes vote down vote up
public SqlJsonObjectFunction() {
  super("JSON_OBJECT", SqlKind.OTHER_FUNCTION, ReturnTypes.VARCHAR_2000,
      (callBinding, returnType, operandTypes) -> {
        RelDataTypeFactory typeFactory = callBinding.getTypeFactory();
        for (int i = 0; i < operandTypes.length; i++) {
          if (i % 2 == 0) {
            operandTypes[i] = typeFactory.createSqlType(SqlTypeName.VARCHAR);
            continue;
          }
          operandTypes[i] = typeFactory.createTypeWithNullability(
              typeFactory.createSqlType(SqlTypeName.ANY), true);
        }
      }, null, SqlFunctionCategory.SYSTEM);
}
 
Example 7
Source File: SqlJsonArrayFunction.java    From Bats with Apache License 2.0 4 votes vote down vote up
public SqlJsonArrayFunction() {
  super("JSON_ARRAY", SqlKind.OTHER_FUNCTION, ReturnTypes.VARCHAR_2000, null,
      OperandTypes.VARIADIC, SqlFunctionCategory.SYSTEM);
}
 
Example 8
Source File: SqlStringContextVariable.java    From Bats with Apache License 2.0 4 votes vote down vote up
protected SqlStringContextVariable(String name) {
  super(name, ReturnTypes.VARCHAR_2000, SqlFunctionCategory.SYSTEM);
}
 
Example 9
Source File: SqlJsonObjectFunction.java    From Bats with Apache License 2.0 4 votes vote down vote up
public SqlJsonObjectFunction() {
  super("JSON_OBJECT", SqlKind.OTHER_FUNCTION, ReturnTypes.VARCHAR_2000, null,
      null, SqlFunctionCategory.SYSTEM);
}
 
Example 10
Source File: SqlJsonArrayFunction.java    From calcite with Apache License 2.0 4 votes vote down vote up
public SqlJsonArrayFunction() {
  super("JSON_ARRAY", SqlKind.OTHER_FUNCTION, ReturnTypes.VARCHAR_2000,
      InferTypes.ANY_NULLABLE, OperandTypes.VARIADIC, SqlFunctionCategory.SYSTEM);
}
 
Example 11
Source File: SqlStringContextVariable.java    From calcite with Apache License 2.0 4 votes vote down vote up
protected SqlStringContextVariable(String name) {
  super(name, ReturnTypes.VARCHAR_2000, SqlFunctionCategory.SYSTEM);
}