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