com.mapd.calcite.parser.HeavyDBSqlOperatorTable.MLPredict.MLPredict |
( |
| ) |
|
|
inline |
boolean com.mapd.calcite.parser.HeavyDBSqlOperatorTable.MLPredict.checkOperandTypes |
( |
SqlCallBinding |
callBinding, |
|
|
boolean |
throwOnFailure |
|
) |
| |
|
inline |
Definition at line 770 of file HeavyDBSqlOperatorTable.java.
775 final SqlValidator validator = callBinding.getValidator();
777 final int num_operands = callBinding.getOperandCount();
778 if (num_operands < 2) {
779 throw new IllegalArgumentException(
780 "At least 2 arguments are required, the model name and one or more predictors.");
782 for (
int operand_idx = 0; operand_idx < num_operands; operand_idx++) {
783 final SqlNode operand = callBinding.operand(operand_idx);
784 final SqlTypeName operand_type =
785 validator.getValidatedNodeType(operand).getSqlTypeName();
786 final SqlTypeFamily operand_type_family = operand_type.getFamily();
787 if (operand_idx == 0) {
788 if (!operand.isA(EnumSet.of(SqlKind.LITERAL))
789 || operand_type_family != SqlTypeFamily.CHARACTER) {
790 throw new IllegalArgumentException(
791 "First argument must be TEXT literal denoting the model name.");
794 if (operand.isA(EnumSet.of(SqlKind.LITERAL))) {
795 throw new IllegalArgumentException(
796 "Literals are not supported as predictors.");
798 if (!(operand_type_family == SqlTypeFamily.NUMERIC
799 || operand_type_family == SqlTypeFamily.CHARACTER)) {
800 throw new IllegalArgumentException(
801 "Only TEXT and NUMERIC predictors are supported.");
SqlOperandCountRange com.mapd.calcite.parser.HeavyDBSqlOperatorTable.MLPredict.getOperandCountRange |
( |
| ) |
|
|
inline |
RelDataType com.mapd.calcite.parser.HeavyDBSqlOperatorTable.MLPredict.inferReturnType |
( |
SqlOperatorBinding |
opBinding | ) |
|
|
inline |
Definition at line 758 of file HeavyDBSqlOperatorTable.java.
759 final RelDataTypeFactory typeFactory = opBinding.getTypeFactory();
760 return typeFactory.createTypeWithNullability(
761 typeFactory.createSqlType(SqlTypeName.DOUBLE),
true);
The documentation for this class was generated from the following file: