def validate_type_hint(hint: Any) -> str:
    """
    Validates and returns the SQL type for a given type hint.

    Handles `typing.Optional` by extracting the underlying type and ensures that
    `typing.Any` is not used.

    Args:
        hint: The type hint to validate.

    Returns:
        The corresponding SQL type.
    """
    if hasattr(hint, "__origin__") and hint.__origin__ is Union:
        non_none_types = [t for t in hint.__args__ if t is not type(None)]
        if len(non_none_types) == 1:
            return python_type_to_sql_type(non_none_types[0])
        else:
            raise ValueError(f"Unsupported type union: {hint}")
    if hint is Any:
        raise ValueError(
            "Unsupported Python type: typing.Any is not allowed. Please specify a concrete type."
        )
    return python_type_to_sql_type(hint)

    Validates and returns the SQL type for a given type hint.

    Handles `typing.Optional` by extracting the underlying type and ensures that
    `typing.Any` is not used.

    Args:
        hint: The type hint to validate.

    Returns:
        The corresponding SQL type.
    
ai/core/src/unitycatalog/ai/core/utils/callable_utils.py