arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2107.11347cs.PLcs.DB
收藏

理解空值

Comprehending nulls

James Cheney, Wilmer Ricciotti

摘要:

嵌套关系演算(NRC)是一种有影响力的高级查询语言,它提供了强大的功能和灵活性,同时仍然允许转换为标准SQL查询。它也被用作程序设计语言(如F#、Scala和Links)中语言集成查询的基础。然而,SQL使用空值和三值逻辑处理不完整信息,与基于二值逻辑的“标准”NRC不兼容。空值在实践中被广泛用于不完整的数据,但如何在NRC中容纳SQL风格的空值和不完整的信息,或将此类查询集成到类型化程序设计语言中,似乎还没有得到彻底的研究。在本文中,我们考虑两种方法:显式的方法,其中选项类型被用来表示(可能)空的原始类型,和隐式的方法,其中类型被视为possibly-null默认。我们给翻译有关的隐式和显式的方法,讨论处理语言集成中的空值,和素描扩展的规范化和保守性的结果。

英文摘要:

The Nested Relational Calculus (NRC) has been an influential high-level query language, providing power and flexibility while still allowing translation to standard SQL queries. It has also been used as a basis for language-integrated query in programming languages such as F#, Scala, and Links. However, SQL's treatment of incomplete information, using nulls and three-valued logic, is not compatible with `standard' NRC based on two-valued logic. Nulls are widely used in practice for incomplete data, but the question of how to accommodate SQL-style nulls and incomplete information in NRC, or integrate such queries into a typed programming language, appears not to have been studied thoroughly. In this paper we consider two approaches: an explicit approach in which option types are used to represent (possibly) nullable primitive types, and an implicit approach in which types are treated as possibly-null by default. We give translations relating the implicit and explicit approaches, discuss handling nulls in language integration, and sketch extensions of normalization and conservativity results.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑