### Description

#27647 has introduced filtering for invalid schemas in Hive hook based on the characters `;` and `!`. I'm wondering if a more generic filtering could be introduced, e.g. one that adheres to the regex `[^a-z0-9_]`, since Hive schemas (and table names) can only contain alphanumeric characters and the character `_`.

Note: since the Hive metastore [stores schemas and tables in lowercase](https://stackoverflow.com/questions/57181316/how-to-keep-column-names-in-camel-case-in-hive/57183048#57183048), checking against `[^a-z0-9_]` is probably better than `[^a-zA-Z0-9_]`.

### Use case/motivation

Ensure that Hive schemas used in `apache-airflow-providers-apache-hive` hooks contain no invalid characters.

### Related issues

_No response_

### Are you willing to submit a PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

max_partition = HiveMetastoreHook._get_max_partition_from_part_specs(
            [{"key1": "value1", "key2": "value2"}, {"key1": "value3", "key2": "value4"}],
            "key1",
            self.VALID_FILTER_MAP,
        )
        assert isinstance(max_partition, str)
    @mock.patch(
        "airflow.providers.apache.hive.hooks.hive.HiveMetastoreHook._find_valid_host",
        return_value="localhost",
    )
    @mock.patch("airflow.providers.apache.hive.hooks.hive.socket")
    def test_error_metastore_client(self, socket_mock, _find_valid_host_mock):
        socket_mock.socket.return_value.connect_ex.return_value = 0
        self.hook.get_metastore_client()
    @mock.patch(
        "airflow.providers.apache.hive.hooks.hive.HiveMetastoreHook.get_connection",
        return_value=Connection(host="metastore1.host,metastore2.host", port=9802),
    )
    @mock.patch("airflow.providers.apache.hive.hooks.hive.socket")
    def test_ha_hosts(self, socket_mock, get_connection_mock):
        socket_mock.socket.return_value.connect_ex.return_value = 1
        with pytest.raises(AirflowException):
            HiveMetastoreHook()
        assert socket_mock.socket.call_count == 2
    def test_get_conn(self):