Skip to content

[CALCITE-7415] CalciteCatalogReader.lookupOperatorOverloads keeps original function identifier casing instead of resolved schema-path casing#4794

Open
zzwqqq wants to merge 2 commits intoapache:mainfrom
zzwqqq:fix_func_identifier
Open

[CALCITE-7415] CalciteCatalogReader.lookupOperatorOverloads keeps original function identifier casing instead of resolved schema-path casing#4794
zzwqqq wants to merge 2 commits intoapache:mainfrom
zzwqqq:fix_func_identifier

Conversation

@zzwqqq
Copy link
Contributor

@zzwqqq zzwqqq commented Feb 13, 2026

@zzwqqq zzwqqq force-pushed the fix_func_identifier branch from 89bd682 to 63c10f1 Compare February 13, 2026 13:19
…ginal function identifier casing instead of resolved schema-path casing
@zzwqqq zzwqqq force-pushed the fix_func_identifier branch from 63c10f1 to 9e9a8f4 Compare February 13, 2026 13:47
return functions2;
}

private static SqlIdentifier resolvedFunctionIdentifier(CalciteSchema schema,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see what this has anything to do with functions. This function seems to be very generic, and work for all all identifiers. Could it be called "createResolvedIdentifier"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have rename resolvedFunctionIdentifier to createResolvedIdentifier. Thanks.

resolvedNames.addAll(
schemaPath.subList(schemaPath.size() - resolvedQualifierCount, schemaPath.size()));
resolvedNames.add(functionName);
return new SqlIdentifier(resolvedNames, SqlParserPos.ZERO);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about passing the position of the original identifier too?
Positions can be very useful for error reporting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this.
I have updated to keep the original identifier position (opName.getParserPosition()) when creating the resolved identifier, instead of using SqlParserPos.ZERO

checkInternal(false);
}

@Test void testLookupQualifiedNameUsesResolvedCase() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment for each of these summarizing what is being tested?
E.g., "lookup MyCatalog.MySchema.MyFUNC as myfunc"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added short comments above each new test to summarize the exact lookup scenario being verified (including concrete identifier examples). Thanks.

…riginal SqlParserPos andd add comments for tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants