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

`t` BIGINT,
                `f` DOUBLE,
                `c` STRING,
                `M` TIMESTAMP,
                `O` STRING,
                `S` STRING,
                `U` STRING,
                `V` STRING)
            ROW FORMAT DELIMITED
            FIELDS TERMINATED BY ','
            STORED AS textfile
            ;
        """
        assert_equal_ignore_multiple_spaces(self, mock_run_cli.call_args_list[0][0][0], query)
class TestHiveMetastoreHook(TestHiveEnvironment):
    VALID_FILTER_MAP = {"key2": "value2"}
    def test_get_max_partition_from_empty_part_specs(self):
        max_partition = HiveMetastoreHook._get_max_partition_from_part_specs(
            [], "key1", self.VALID_FILTER_MAP
        )
        assert max_partition is None
    
    def test_get_max_partition_from_valid_part_specs_and_invalid_filter_map(self):
        with pytest.raises(AirflowException):
            HiveMetastoreHook._get_max_partition_from_part_specs(
                [{"key1": "value1", "key2": "value2"}, {"key1": "value3", "key2": "value4"}],
                "key1",
                {"key3": "value5"},
            )
    def test_get_max_partition_from_valid_part_specs_and_invalid_partition_key(self):