HIVE-8536: fix cast exception