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