public HiveUDFOperator(String name, SqlReturnTypeInference sqlReturnTypeInference) { super(new SqlIdentifier(name, SqlParserPos.ZERO), sqlReturnTypeInference, null, ArgChecker.INSTANCE, null, SqlFunctionCategory.USER_DEFINED_FUNCTION); }
/** * Parses a simple identifier as an SqlIdentifier. */ final public SqlIdentifier SimpleIdentifier() throws ParseException { final String p; p = Identifier(); {if (true) return new SqlIdentifier(p, getPos());} throw new Error("Missing return statement in function"); }
final public SqlIdentifier CollectionsTypeName() throws ParseException { jj_consume_token(MULTISET); {if (true) return new SqlIdentifier( SqlTypeName.MULTISET.name(), getPos());} throw new Error("Missing return statement in function"); }
maybeCast(selectItem, type, type2), maybeCast(selectItem1, type1, type2)), new SqlIdentifier(name, SqlParserPos.ZERO)); type = typeFactory.createTypeWithNullability(type2, nullable);
/** * Parses a simple identifier as an SqlIdentifier. */ final public SqlIdentifier SimpleIdentifier() throws ParseException { final String p; p = Identifier(); {if (true) return new SqlIdentifier(p, getPos());} throw new Error("Missing return statement in function"); }
{if (true) return SqlIdentifier.star(list, pos, posList);} {if (true) return new SqlIdentifier(list, null, pos, posList);} throw new Error("Missing return statement in function");
private List<Map.Entry<String, RelDataType>> validateMeasure(SqlMatchRecognize mr, MatchRecognizeScope scope, boolean allRows) { final List<String> aliases = new ArrayList<>(); final List<SqlNode> sqlNodes = new ArrayList<>(); final SqlNodeList measures = mr.getMeasureList(); final List<Map.Entry<String, RelDataType>> fields = new ArrayList<>(); for (SqlNode measure : measures) { assert measure instanceof SqlCall; final String alias = deriveAlias(measure, aliases.size()); aliases.add(alias); SqlNode expand = expand(measure, scope); expand = navigationInMeasure(expand, allRows); setOriginal(expand, measure); inferUnknownTypes(unknownType, scope, expand); final RelDataType type = deriveType(scope, expand); setValidatedNodeType(measure, type); fields.add(Pair.of(alias, type)); sqlNodes.add( SqlStdOperatorTable.AS.createCall(SqlParserPos.ZERO, expand, new SqlIdentifier(alias, SqlParserPos.ZERO))); } SqlNodeList list = new SqlNodeList(sqlNodes, measures.getParserPosition()); inferUnknownTypes(unknownType, scope, list); for (SqlNode node : list) { validateExpr(node, scope); } mr.setOperand(SqlMatchRecognize.OPERAND_MEASURES, list); return fields; }
final public SqlIdentifier CollectionsTypeName() throws ParseException { jj_consume_token(MULTISET); {if (true) return new SqlIdentifier( SqlTypeName.MULTISET.name(), getPos());} throw new Error("Missing return statement in function"); }
selectItem.getParserPosition(), expanded, new SqlIdentifier(alias, SqlParserPos.ZERO)); deriveTypeImpl(selectScope, expanded);
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); }
new SqlIdentifier( op.getName(), pos);
{if (true) return SqlIdentifier.star(list, pos, posList);} {if (true) return new SqlIdentifier(list, null, pos, posList);} throw new Error("Missing return statement in function");
final public SqlIdentifier TypeName() throws ParseException { final SqlTypeName sqlTypeName; final SqlIdentifier typeName; final Span s = Span.of(); if (jj_2_432(2)) { sqlTypeName = SqlTypeName(s); typeName = new SqlIdentifier(sqlTypeName.name(), s.end(this)); } else if (jj_2_433(2)) { typeName = CollectionsTypeName(); } else if (jj_2_434(2)) { typeName = CompoundIdentifier(); } else { jj_consume_token(-1); throw new ParseException(); } {if (true) return typeName;} throw new Error("Missing return statement in function"); }
SqlDataTypeSpec findTargetSqlDataTypeSpec(SqlDataTypeSpec typeSpec) { if (sourceDS == null || targetDS == null || typeSpec == null) return null; List<TypeDef> validTypeDefs = sourceDS.getTypeDefsByName(typeSpec.getTypeName().toString()); if (validTypeDefs != null) { for (TypeDef typeDef : validTypeDefs) { if (typeDef.getMaxPrecision() >= typeSpec.getPrecision()) { TypeDef targetType = targetDS.getTypeDef(typeDef.getId()); return new SqlDataTypeSpec(new SqlIdentifier(targetType.getName(), typeSpec.getParserPosition()), targetType.getDefaultPrecision() >= 0 ? targetType.getDefaultPrecision() : typeSpec.getPrecision(), targetType.getDefaultScale() >= 0 ? targetType.getDefaultScale() : typeSpec.getScale(), typeSpec.getCharSetName(), typeSpec.getTimeZone(), typeSpec.getParserPosition()); } } } return null; }
jj_consume_token(ON); val = new SqlIdentifier(token.image.toUpperCase(Locale.ROOT), getPos()); } else { } else if (jj_2_311(2)) { jj_consume_token(ALL); name = new SqlIdentifier(token.image.toUpperCase(Locale.ROOT), getPos()); } else {
new SqlIdentifier(alias, SqlParserPos.ZERO)));
final public SqlIdentifier TypeName() throws ParseException { final SqlTypeName sqlTypeName; final SqlIdentifier typeName; final Span s = Span.of(); if (jj_2_432(2)) { sqlTypeName = SqlTypeName(s); typeName = new SqlIdentifier(sqlTypeName.name(), s.end(this)); } else if (jj_2_433(2)) { typeName = CollectionsTypeName(); } else if (jj_2_434(2)) { typeName = CompoundIdentifier(); } else { jj_consume_token(-1); throw new ParseException(); } {if (true) return typeName;} throw new Error("Missing return statement in function"); }
jj_consume_token(ON); val = new SqlIdentifier(token.image.toUpperCase(Locale.ROOT), getPos()); } else { } else if (jj_2_311(2)) { jj_consume_token(ALL); name = new SqlIdentifier(token.image.toUpperCase(Locale.ROOT), getPos()); } else {
throw new ParseException(); {if (true) return new SqlIdentifier(unquotedIdentifier(), getPos());} throw new Error("Missing return statement in function");
throw new ParseException(); {if (true) return new SqlIdentifier(unquotedIdentifier(), getPos());} throw new Error("Missing return statement in function");