Skip to content

Conversation

Copy link

Copilot AI commented Sep 11, 2025

The initcap function was already implemented and registered in the hive function namespace but lacked proper test coverage. This PR adds comprehensive test cases to ensure the function works correctly.

Changes Made

  1. Added test cases in TestHiveScalarFunctions.java to verify initcap function behavior:

    • Converts lowercase strings: initcap('hello world')'Hello World'
    • Converts uppercase strings: initcap('HELLO WORLD')'Hello World'
    • Handles mixed case strings: initcap('hELLo WoRLd')'Hello World'
  2. Created TestInitCapFunction.java with a unit test to verify the function is properly registered in the hive function registry.

Background

The initcap function was already fully implemented:

  • Registered in FunctionRegistry.java at line 219: system.registerGenericUDF("initcap", GenericUDFInitCap.class)
  • Uses Hive's GenericUDFInitCap class for the actual implementation
  • Available under the hive.default. namespace

This PR ensures the function has proper test coverage and verification, completing the requirement to have the initcap function available and tested under the hive catalog namespace.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@linux-foundation-easycla
Copy link

CLA Not Signed

Copilot AI changed the title [WIP] Add initcap function under hive catalog namespace to the below Add test coverage for initcap function in hive catalog namespace Sep 11, 2025
Copilot AI requested a review from Joe-Abraham September 11, 2025 06:01
Copilot finished work on behalf of Joe-Abraham September 11, 2025 06:01
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