当前位置: 首页>>代码示例>>Java>>正文


Java SqlKind.OTHER_FUNCTION属性代码示例

本文整理汇总了Java中org.apache.calcite.sql.SqlKind.OTHER_FUNCTION属性的典型用法代码示例。如果您正苦于以下问题:Java SqlKind.OTHER_FUNCTION属性的具体用法?Java SqlKind.OTHER_FUNCTION怎么用?Java SqlKind.OTHER_FUNCTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.calcite.sql.SqlKind的用法示例。


在下文中一共展示了SqlKind.OTHER_FUNCTION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SqlDatePartOperator

public SqlDatePartOperator() {
  super(
      "DATE_PART",
      SqlKind.OTHER_FUNCTION,
      ReturnTypes.BIGINT_NULLABLE,
      null,
      OperandTypes.sequence(
          "<PERIOD LITERAL>, <DATE or TIMESTAMP or INTERVAL>",
          new EnumeratedListChecker(VALID_PERIODS.keySet()),
          OperandTypes.or(
              OperandTypes.family(SqlTypeFamily.DATE),
              OperandTypes.family(SqlTypeFamily.TIMESTAMP),
              OperandTypes.family(SqlTypeFamily.DATETIME),
              OperandTypes.family(SqlTypeFamily.DATETIME_INTERVAL),
              OperandTypes.family(SqlTypeFamily.INTERVAL_DAY_TIME),
              OperandTypes.family(SqlTypeFamily.INTERVAL_YEAR_MONTH))
          ),
          SqlFunctionCategory.SYSTEM);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:19,代码来源:SqlDatePartOperator.java

示例2: unparseDatetimeFunction

/**
 * Most dialects that natively support datetime floor will use this.
 * In those cases the call will look like TRUNC(datetime, 'year').
 *
 * @param writer SqlWriter
 * @param call SqlCall
 * @param funName Name of the sql function to call
 * @param datetimeFirst Specify the order of the datetime &amp; timeUnit
 * arguments
 */
public static void unparseDatetimeFunction(SqlWriter writer, SqlCall call,
    String funName, Boolean datetimeFirst) {
  SqlFunction func = new SqlFunction(funName, SqlKind.OTHER_FUNCTION,
      ReturnTypes.ARG0_NULLABLE_VARYING, null, null,
      SqlFunctionCategory.STRING);

  SqlCall call1;
  if (datetimeFirst) {
    call1 = call;
  } else {
    // switch order of operands
    SqlNode op1 = call.operand(0);
    SqlNode op2 = call.operand(1);

    call1 = call.getOperator().createCall(call.getParserPosition(), op2, op1);
  }

  SqlUtil.unparseFunctionSyntax(func, writer, call1);
}
 
开发者ID:apache,项目名称:calcite,代码行数:29,代码来源:SqlFloorFunction.java

示例3: testIsDeterministic

@Test public void testIsDeterministic() {
  SqlOperator ndc = new SqlSpecialOperator(
          "NDC",
          SqlKind.OTHER_FUNCTION,
          0,
          false,
          ReturnTypes.BOOLEAN,
          null, null) {
    @Override public boolean isDeterministic() {
      return false;
    }
  };
  RexNode n = rexBuilder.makeCall(ndc);
  assertFalse(RexUtil.isDeterministic(n));
  assertEquals(0,
          RexUtil.retainDeterministic(RelOptUtil.conjunctions(n)).size());
}
 
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:RexProgramTest.java

示例4: SqlSumCountAggFunction

public SqlSumCountAggFunction(RelDataType type) {
  super("$SUM0",
      SqlKind.OTHER_FUNCTION,
      ReturnTypes.BIGINT, // use the inferred return type of SqlCountAggFunction
      null,
      OperandTypes.NUMERIC,
      SqlFunctionCategory.NUMERIC);

  this.type = type;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:10,代码来源:AggPrelBase.java

示例5: SqlHllAggFunction

public SqlHllAggFunction() {
  super("HLL",
    null,
    SqlKind.OTHER_FUNCTION,
    ReturnTypes.explicit(SqlTypeName.BINARY),
    null,
    OperandTypes.ANY,
    SqlFunctionCategory.USER_DEFINED_FUNCTION,
    false,
    false
  );
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:12,代码来源:AggPrelBase.java

示例6: SqlHllMergeAggFunction

public SqlHllMergeAggFunction() {
  super("NDV_MERGE",
    null,
    SqlKind.OTHER_FUNCTION,
    ReturnTypes.BIGINT_FORCE_NULLABLE,
    null,
    OperandTypes.BINARY,
    SqlFunctionCategory.USER_DEFINED_FUNCTION,
    false,
    false
  );
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:12,代码来源:AggPrelBase.java

示例7: SqlAggOperator

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);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:SqlAggOperator.java

示例8: SqlUserDefinedAggFunction

public SqlUserDefinedAggFunction(SqlIdentifier opName,
                                 SqlReturnTypeInference returnTypeInference,
                                 SqlOperandTypeInference operandTypeInference,
                                 SqlOperandTypeChecker operandTypeChecker,
                                 AggregateFunction function,
                                 Boolean requestsOver) {
    super(Util.last(opName.names), opName, SqlKind.OTHER_FUNCTION,
          returnTypeInference, operandTypeInference, operandTypeChecker,
          SqlFunctionCategory.USER_DEFINED_FUNCTION, false, requestsOver);
    this.function = function;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:11,代码来源:SqlUserDefinedAggFunction.java

示例9: needsFinalColumnReordering

/**
 * Whether this Project requires a final column re-ordering. Returns False for all cases except when
 * convert_fromjson function is present.  For convert_fromjson function, the Project operator at
 * run-time produces an output schema with convert_fromjson expr appended to the end of the schema.
 * We need a final column re-ordering to ensure the correct column order.
*/
@Override
public boolean needsFinalColumnReordering() {
  for (RexNode expr : this.exps) {
    // TODO: a convert_fromjson nested within other convert functions currently does not work.
    // When it is supported, we should enhance this check by using a visitor to find the nested function.
    if (expr.getKind() == SqlKind.OTHER_FUNCTION &&
        expr instanceof RexCall &&
        ((RexCall) expr).getOperator().getName().equalsIgnoreCase("CONVERT_FROMJSON")) {
      return true;
    }
  }
  return false;
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:19,代码来源:ProjectPrel.java

示例10: DrillSqlAggOperator

protected DrillSqlAggOperator(String name, List<DrillFuncHolder> functions, 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);
  this.functions = functions;
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:10,代码来源:DrillSqlAggOperator.java

示例11: SqlUserDefinedAggFunction

/** Creates a SqlUserDefinedAggFunction. */
public SqlUserDefinedAggFunction(SqlIdentifier opName,
    SqlReturnTypeInference returnTypeInference,
    SqlOperandTypeInference operandTypeInference,
    SqlOperandTypeChecker operandTypeChecker, AggregateFunction function,
    boolean requiresOrder, boolean requiresOver, RelDataTypeFactory typeFactory) {
  super(Util.last(opName.names), opName, SqlKind.OTHER_FUNCTION,
      returnTypeInference, operandTypeInference, operandTypeChecker,
      SqlFunctionCategory.USER_DEFINED_FUNCTION, requiresOrder, requiresOver);
  this.function = function;
  this.typeFactory = typeFactory;
}
 
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SqlUserDefinedAggFunction.java

示例12: SqlUserDefinedTableMacro

public SqlUserDefinedTableMacro(SqlIdentifier opName,
    SqlReturnTypeInference returnTypeInference,
    SqlOperandTypeInference operandTypeInference,
    SqlOperandTypeChecker operandTypeChecker, List<RelDataType> paramTypes,
    TableMacro tableMacro) {
  super(Util.last(opName.names), opName, SqlKind.OTHER_FUNCTION,
      returnTypeInference, operandTypeInference, operandTypeChecker,
      Preconditions.checkNotNull(paramTypes),
      SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION);
  this.tableMacro = tableMacro;
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:SqlUserDefinedTableMacro.java

示例13: SqlUserDefinedFunction

/** Constructor used internally and by derived classes. */
protected SqlUserDefinedFunction(SqlIdentifier opName,
    SqlReturnTypeInference returnTypeInference,
    SqlOperandTypeInference operandTypeInference,
    SqlOperandTypeChecker operandTypeChecker,
    List<RelDataType> paramTypes,
    Function function,
    SqlFunctionCategory category) {
  super(Util.last(opName.names), opName, SqlKind.OTHER_FUNCTION,
      returnTypeInference, operandTypeInference, operandTypeChecker,
      paramTypes, category);
  this.function = function;
}
 
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:SqlUserDefinedFunction.java

示例14: SqlCurrentDateFunction

public SqlCurrentDateFunction() {
  super(
      "CURRENT_DATE",
      SqlKind.OTHER_FUNCTION,
      ReturnTypes.DATE,
      null,
      OperandTypes.NILADIC,
      SqlFunctionCategory.TIMEDATE);
}
 
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:SqlCurrentDateFunction.java

示例15: SqlSubstringFunction

/**
 * Creates the SqlSubstringFunction.
 */
SqlSubstringFunction() {
  super(
      "SUBSTRING",
      SqlKind.OTHER_FUNCTION,
      ReturnTypes.ARG0_NULLABLE_VARYING,
      null,
      null,
      SqlFunctionCategory.STRING);
}
 
开发者ID:apache,项目名称:calcite,代码行数:12,代码来源:SqlSubstringFunction.java


注:本文中的org.apache.calcite.sql.SqlKind.OTHER_FUNCTION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。