def process_parameter(
    param_name: str,
    param: inspect.Parameter,
    type_hints: dict[str, Any],
    docstring_info: DocstringInfo,
) -> str:
    """
    Processes a single parameter and returns its SQL definition.

    This function validates the parameter's type hint, handles default values,
    and formats the SQL parameter string accordingly.

    Args:
        param_name: The name of the parameter.
        param: The parameter object.
        type_hints: The type hints dictionary for the function.
        docstring_info: Parsed docstring information.

    Returns:
        The SQL definition string for the parameter.
    """

    if param_name in FORBIDDEN_PARAMS:
        raise ValueError(f"Parameter '{param_name}' is not allowed in the function signature.")

    if param.kind in (inspect.Parameter.VAR_POSITIONAL, inspect.Parameter.VAR_KEYWORD):
        kind = (
            "var-positional (*args)"
            if param.kind == inspect.Parameter.VAR_POSITIONAL
            else "var-keyword (**kwargs)"
        )
        raise ValueError(
            f"Parameter '{param_name}' is a {kind} parameter, which is not supported in SQL functions."
        )

    if param_name not in type_hints:
        raise ValueError(f"Missing type hint for parameter: {param_name}.")

    param_hint = type_hints[param_name]

    try:
        sql_type = validate_type_hint(param_hint)
    except ValueError as e:
        error_message = generate_type_hint_error_message(param_name, param_hint, e)
        raise ValueError(error_message) from e

    param_comment = docstring_info.params.get(param_name, f"Parameter {param_name}").replace(
        "'", '"'
    )

    if param.default is not inspect.Parameter.empty:
        if is_collection_type(param_hint):
            raise ValueError(
                f"Parameter '{param_name}' of type '{param_hint}' cannot have a default value."
            )
        if not is_valid_default_value(param.default, param_hint):
            raise ValueError(
                f"Default value for parameter '{param_name}' does not match the type hint '{param_hint}'."
            )
        default_value = format_default_value(param.default)
        return f"{param_name} {sql_type} DEFAULT {default_value} COMMENT '{param_comment}'"
    else:
        return f"{param_name} {sql_type} COMMENT '{param_comment}'"

    Processes a single parameter and returns its SQL definition.

    This function validates the parameter's type hint, handles default values,
    and formats the SQL parameter string accordingly.

    Args:
        param_name: The name of the parameter.
        param: The parameter object.
        type_hints: The type hints dictionary for the function.
        docstring_info: Parsed docstring information.

    Returns:
        The SQL definition string for the parameter.
    
ai/core/src/unitycatalog/ai/core/utils/callable_utils.py