### 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)

MockHiveCliHook,
    MockHiveServer2Hook,
    MockSubProcess,
)
from tests.test_utils.asserts import assert_equal_ignore_multiple_spaces
DEFAULT_DATE = timezone.datetime(2015, 1, 1)
DEFAULT_DATE_ISO = DEFAULT_DATE.isoformat()
DEFAULT_DATE_DS = DEFAULT_DATE_ISO[:10]
class EmptyMockConnectionCursor(BaseMockConnectionCursor):
    def __init__(self):
        super().__init__()
        self.iterable = []
class TestHiveEnvironment(unittest.TestCase):
    def setUp(self):
        self.next_day = (DEFAULT_DATE + datetime.timedelta(days=1)).isoformat()[:10]
        self.database = "airflow"
        self.partition_by = "ds"
        self.table = "static_babynames_partitioned"
        with mock.patch(
            "airflow.providers.apache.hive.hooks.hive.HiveMetastoreHook.get_metastore_client"
        ) as get_metastore_mock, mock.patch(
            "airflow.providers.apache.hive.hooks.hive.HiveMetastoreHook.get_connection"
        ):
            get_metastore_mock.return_value = mock.MagicMock()
            self.hook = HiveMetastoreHook()
class TestHiveCliHook(unittest.TestCase):
    @mock.patch("tempfile.tempdir", "/tmp/")
    @mock.patch("tempfile._RandomNameSequence.__next__")
    @mock.patch("subprocess.Popen")
    def test_run_cli(self, mock_popen, mock_temp_dir):