Cardinality is a critical input to the query planning process, especially join planning. Impala has many high-level end-to-end tests that implicitly test cardinality at the "wholesale" level: A test will produce a wrong result if the cardinality is badly wrong.
But, at present, no detailed unit tests exist for this topic. This ticket asks to add tests for:
- Table cardinality, NDV values and null count in metadata retrieved from HMS.
- Table cardinality, NDV values and null counts in metadata presented to the query.
- Expression NDV and selectivity values (which derive from table cardinality and column NDV.)
Since none of the existing "functional" tables provide the level of detail needed for these tests, add a new test table specifically for this task.