English

Query Lifting: Language-integrated query for heterogeneous nested collections

Programming Languages 2021-07-20 v2 Databases

Abstract

Language-integrated query based on comprehension syntax is a powerful technique for safe database programming, and provides a basis for advanced techniques such as query shredding or query flattening that allow efficient programming with complex nested collections. However, the foundations of these techniques are lacking: although SQL, the most widely-used database query language, supports heterogeneous queries that mix set and multiset semantics, these important capabilities are not supported by known correctness results or implementations that assume homogeneous collections. In this paper we study language-integrated query for a heterogeneous query language NRCλ(Set,Bag)NRC_\lambda(Set,Bag) that combines set and multiset constructs. We show how to normalize and translate queries to SQL, and develop a novel approach to querying heterogeneous nested collections, based on the insight that ``local'' query subexpressions that calculate nested subcollections can be ``lifted'' to the top level analogously to lambda-lifting for local function definitions.

Keywords

Cite

@article{arxiv.2101.04102,
  title  = {Query Lifting: Language-integrated query for heterogeneous nested collections},
  author = {Wilmer Ricciotti and James Cheney},
  journal= {arXiv preprint arXiv:2101.04102},
  year   = {2021}
}

Comments

Full version of ESOP 2021 conference paper

R2 v1 2026-06-23T22:01:26.590Z