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

How to use
explicit
method
in
org.apache.calcite.sql.type.ReturnTypes

Best Java code snippets using org.apache.calcite.sql.type.ReturnTypes.explicit (Showing top 20 results out of 315)

origin: apache/incubator-druid

 ApproxCountDistinctSqlAggFunction()
 {
  super(
    NAME,
    null,
    SqlKind.OTHER_FUNCTION,
    ReturnTypes.explicit(SqlTypeName.BIGINT),
    InferTypes.VARCHAR_1024,
    OperandTypes.ANY,
    SqlFunctionCategory.STRING,
    false,
    false
  );
 }
}
origin: apache/incubator-druid

public OperatorBuilder nullableReturnType(final SqlTypeName typeName)
{
 this.returnTypeInference = ReturnTypes.explicit(
   factory -> Calcites.createSqlTypeWithNullability(factory, typeName, true)
 );
 return this;
}
origin: apache/incubator-druid

public OperatorBuilder returnType(final SqlTypeName typeName)
{
 this.returnTypeInference = ReturnTypes.explicit(
   factory -> Calcites.createSqlType(factory, typeName)
 );
 return this;
}
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/hive

@Override
public AggregateCall other(RelDataTypeFactory typeFactory, AggregateCall e) {
 RelDataType countRetType = typeFactory.createTypeWithNullability(typeFactory.createSqlType(SqlTypeName.BIGINT), true);
 return AggregateCall.create(
  new HiveSqlCountAggFunction(isDistinct, ReturnTypes.explicit(countRetType), operandTypeInference, operandTypeChecker),
  false, ImmutableIntList.of(), -1, countRetType, "count");
}
origin: apache/drill

@Override
public AggregateCall other(RelDataTypeFactory typeFactory, AggregateCall e) {
 RelDataType countRetType = typeFactory.createTypeWithNullability(typeFactory.createSqlType(SqlTypeName.BIGINT), true);
 return AggregateCall.create(
  new HiveSqlCountAggFunction(isDistinct, ReturnTypes.explicit(countRetType), operandTypeInference, operandTypeChecker),
  false, ImmutableIntList.of(), -1, countRetType, "count");
}
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/incubator-druid

 QuantileSqlAggFunction()
 {
  super(
    NAME,
    null,
    SqlKind.OTHER_FUNCTION,
    ReturnTypes.explicit(SqlTypeName.DOUBLE),
    null,
    OperandTypes.or(
      OperandTypes.and(
        OperandTypes.sequence(SIGNATURE1, OperandTypes.ANY, OperandTypes.LITERAL),
        OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC)
      ),
      OperandTypes.and(
        OperandTypes.sequence(SIGNATURE2, OperandTypes.ANY, OperandTypes.LITERAL, OperandTypes.LITERAL),
        OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.NUMERIC, SqlTypeFamily.EXACT_NUMERIC)
      )
    ),
    SqlFunctionCategory.NUMERIC,
    false,
    false
  );
 }
}
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/flink

new SqlFunction(
  type.getSqlIdentifier(),
  ReturnTypes.explicit(type),
  null,
  null,
origin: apache/hive

new HiveSqlSumAggFunction(
  oldCall.isDistinct(),
  ReturnTypes.explicit(sumReturnType),
  oldCall.getAggregation().getOperandTypeInference(),
new HiveSqlCountAggFunction(
  oldCall.isDistinct(),
  ReturnTypes.explicit(countRetType),
  oldCall.getAggregation().getOperandTypeInference(),
origin: apache/hive

new HiveSqlSumAggFunction(
  oldCall.isDistinct(),
  ReturnTypes.explicit(sumSquaredReturnType),
  InferTypes.explicit(Collections.singletonList(argSquared.getType())),
new HiveSqlSumAggFunction(
  oldCall.isDistinct(),
  ReturnTypes.explicit(sumReturnType),
  InferTypes.explicit(Collections.singletonList(argOrdinalType)),
new HiveSqlCountAggFunction(
  oldCall.isDistinct(),
  ReturnTypes.explicit(countRetType),
  oldCall.getAggregation().getOperandTypeInference(),
origin: apache/hive

new HiveSqlSumAggFunction(
  oldCall.isDistinct(),
  ReturnTypes.explicit(sumReturnType),
  oldCall.getAggregation().getOperandTypeInference(),
origin: Qihoo360/Quicksql

SqlDefaultOperator() {
 super("DEFAULT", SqlKind.DEFAULT, 100, true,
   ReturnTypes.explicit(SqlTypeName.ANY), InferTypes.RETURN_TYPE,
   OperandTypes.NILADIC);
}
origin: org.apache.calcite/calcite-core

SqlDefaultOperator() {
 super("DEFAULT", SqlKind.DEFAULT, 100, true,
   ReturnTypes.explicit(SqlTypeName.ANY), InferTypes.RETURN_TYPE,
   OperandTypes.NILADIC);
}
origin: Qihoo360/Quicksql

/**
 * Creates an inference rule which returns a copy of a given data type.
 */
public static ExplicitReturnTypeInference explicit(RelDataType type) {
 return explicit(RelDataTypeImpl.proto(type));
}
origin: org.apache.calcite/calcite-core

/**
 * Creates an inference rule which returns a copy of a given data type.
 */
public static ExplicitReturnTypeInference explicit(RelDataType type) {
 return explicit(RelDataTypeImpl.proto(type));
}
origin: Qihoo360/Quicksql

/**
 * Creates an inference rule which returns a type with no precision or scale,
 * such as {@code DATE}.
 */
public static ExplicitReturnTypeInference explicit(SqlTypeName typeName) {
 return explicit(RelDataTypeImpl.proto(typeName, false));
}
origin: org.apache.calcite/calcite-core

/**
 * Creates an inference rule which returns a type with no precision or scale,
 * such as {@code DATE}.
 */
public static ExplicitReturnTypeInference explicit(SqlTypeName typeName) {
 return explicit(RelDataTypeImpl.proto(typeName, false));
}
origin: org.apache.calcite/calcite-core

public SqlJsonApiCommonSyntaxOperator() {
 super("JSON_API_COMMON_SYNTAX", SqlKind.JSON_API_COMMON_SYNTAX, 100, true,
   ReturnTypes.explicit(SqlTypeName.ANY), null,
   OperandTypes.family(SqlTypeFamily.ANY, SqlTypeFamily.STRING));
}
org.apache.calcite.sql.typeReturnTypesexplicit

Javadoc

Creates an inference rule which returns a copy of a given data type.

Popular methods of ReturnTypes

  • cascade
    Creates a return-type inference that applies a rule then a sequence of transforms.

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JComboBox (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Github Copilot 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