Jayesh Lalwani created FLINK-39433:
--------------------------------------
Summary: Consolidate scattered Hive reflection calls into
HiveShim for type safety
Key: FLINK-39433
URL: https://issues.apache.org/jira/browse/FLINK-39433
Project: Flink
Issue Type: Improvement
Components: Connectors / Hive
Reporter: Jayesh Lalwani
The HiveShim abstraction exists to isolate version-specific Hive API
differences behind typed methods. However, 38 raw reflection calls
(getMethod/invoke/Class.forName) are scattered across 13 files outside
HiveShim, bypassing the shim and losing compile-time type checking.
This makes Hive version upgrades harder — breakages are only discovered at
runtime when reflection fails. For example, during Hive 4 support work
(FLINK-35515), several API changes (HiveFileFormatUtils.getRecordWriter
signature change, SerDeUtils.initializeSerDe removal) were only caught by
running tests because the calls used raw reflection instead of typed HiveShim
methods.
Affected files:
- HiveWriterFactory.java
- HiveMapredSplitReader.java
- HiveTableSink.java
- HiveSessionState.java
- HiveParserUtils.java
- HiveReflectionUtils.java
- MRSplitsGetter.java
- HiveTableMetaStoreFactory.java
- ThriftObjectConversions.java
- HiveSimpleUDF.java
- HiveFunctionDefinitionFactory.java
- HiveCatalogUtils.java
- HiveScriptTransformOperator.java
Proposal: Move these reflection calls into typed HiveShim methods with proper
return types, so version-specific differences are caught at compile time and
callers get type safety.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)