Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public class UdfMetadata {

public UdfMetadata(String name, String description, Method udfMethod, Config udfConfig, List<SamzaSqlFieldType> arguments,
SamzaSqlFieldType returnType, boolean disableArgCheck) {
this.name = name;
// Udfs are case insensitive
this.name = name.toUpperCase();
this.description = description;
this.udfMethod = udfMethod;
this.udfConfig = udfConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ private SqlOperator getSqlOperator(SamzaSqlScalarFunctionImpl scalarFunction) {
@Override
public void lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax,
List<SqlOperator> operatorList) {
operatorTable.lookupOperatorOverloads(opName, category, syntax, operatorList);
SqlIdentifier upperCaseOpName = opName;
// Only udfs are case insensitive
if (category != null && category.equals(SqlFunctionCategory.USER_DEFINED_FUNCTION)) {
upperCaseOpName = new SqlIdentifier(opName.names.get(0).toUpperCase(), opName.getComponentParserPosition(0));
}
operatorTable.lookupOperatorOverloads(upperCaseOpName, category, syntax, operatorList);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ public void testEndToEndUdf() throws Exception {
TestAvroSystemFactory.messages.clear();
Map<String, String> staticConfigs = SamzaSqlTestConfig.fetchStaticConfigsWithFactories(configs, numMessages);
String sql1 = "Insert into testavro.outputTopic(id, long_value) "
+ "select id, MyTest(id) as long_value from testavro.SIMPLE1";
+ "select id, MYTest(id) as long_value from testavro.SIMPLE1";
List<String> sqlStmts = Collections.singletonList(sql1);
staticConfigs.put(SamzaSqlApplicationConfig.CFG_SQL_STMTS_JSON, JsonUtil.toJson(sqlStmts));
runApplication(new MapConfig(staticConfigs));
Expand Down