HIVE-28618: TestGenericUDTFGetSQLSchema to run on Tez #5777
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Let
TestGenericUDTFGetSQLSchema.testWithDDL
on Tez.https://issues.apache.org/jira/browse/HIVE-28618
On Tez, we see the NPE when we run StatsRulesProcFactory, which is triggered by TezCompiler.
SHOW TABLES
is a DDL that doesn't scan a regular table. So, some attributes are missing.On MapReduce, StatsRulesProcFactory is not enabled unless isExplainSkipExecution is enabled. As far as I tested it, it is skipped when we pass
SHOW TABLES
to the UDF. I've not detailed the intention as MR is already deprecated.This change will let the UDF choose a correct SemanticAnalyzer based on the statement. I think this change is safe as long as I see the usage of
ParseUtils. parseQueryAndGetSchema
.Why are the changes needed?
To discontinue Hive on MR.
Does this PR introduce any user-facing change?
The behavior of GenericUDTFGetSQLSchema will be consistent with MapReduce.
How was this patch tested?
Updated the unit test