A Databricks RAG pipeline retrieves candidates from two sources: semantic search over Databricks Vector Search and keyword search over document metadata. Each source returns a sorted list of (doc_id, score) pairs for a query, where scores are normalized within that source. Write a function that merges the two ranked lists into a final top-K result using weighted reciprocal rank fusion or another clearly defined ranking strategy. The function should deduplicate documents, preserve deterministic ordering, and run in O((n + m) log k) or better for lists of lengths n and m. Expected solution outline: use a heap or hash map to accumulate fused scores, define tie-breaking, discuss why hybrid retrieval helps RAG quality, and explain how this fits into a Mosaic AI / Databricks retrieval pipeline.