AptMQL-Bench: From Text-to-SQL to Text-to-MQL via Access-Pattern Schema Design and Data-Preserving Migration
This study addresses the limitations of existing text-to-MQL benchmarks, where mechanical translation causes information loss and query inefficiency, hindering natural language querying over document databases. We propose an access-pattern-driven construction paradigm that abandons heuristic conversion in favor of a human-in-the-loop workflow with coding agents. By designing native MongoDB schemas according to anticipated access patterns and performing query rewriting, our approach achieves lossless migration from SQLite to document databases. Based on this methodology, we introduce AptMQL-Bench, comprising 21 databases and 3,186 samples. Evaluations reveal that even the strongest model attains only 57.38% accuracy, demonstrating the substantial challenge and research value of this task.