Language-Integrated Query with Nested Data Structures and Grouping

被引:3
|
作者
Okura, Rui [1 ]
Kameyama, Yukiyoshi [1 ]
机构
[1] Univ Tsukuba, Tsukuba, Ibaraki, Japan
关键词
Database; Language-integrated query; Grouping; Aggregation; Normalization; Type safety;
D O I
10.1007/978-3-030-59025-3_9
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Language-integrated query adds to database query the power of highlevel programming languages such as abstraction, compositionality, and nested data structures. Cheney et al. designed a two-level typed language for it and showed that any closed term of suitable type can be normalized to a single SQL query which does not have nested data structures nor nested SELECT clauses. This paper extends their language to cover the GROUP BY clause in SQL to express grouping and aggregate functions. Although the GROUP BY clause is frequently used, it is not covered by existing studies on efficient implementation of language-integrated queries. In fact, it seems impossible to express composition of two aggregate functions by a single aggregate function, therefore, there exists a query with nested GROUP BY clauses which has no equivalent query without nested one. However, since several database engines such as PostgreSQL allow nested queries, we can still ask if it is possible to convert an arbitrary query with grouping and aggregation to a single query in SQL which allows nested queries, but disallows nested data structures such as a table of tables. This paper solves the latter question affirmatively. Our key observation is that the GROUP BY clause in SQL does two different kinds of things: manipulating input/output data and grouping with aggregation, the former can be transformed, but may have complex types, while the latter cannot be transformed, but has simple types. Hence, we decouple the GROUP BY clause and introduce primitives into our language-integrated query to obtain a calculus which can express GROUP BY. We then show our language has the normalization property that every query is converted to a single query which does not have nested data structures. We conduct simple benchmarks which show that queries in our language can be transformed to efficient SQL queries.
引用
收藏
页码:139 / 158
页数:20
相关论文
共 50 条
  • [41] A family of nested query languages for semi-structured data
    Bidoit, N
    Maabout, S
    Ykhlef, M
    [J]. FOUNDATIONS OF INFORMATION AND KNOWLEDGE SYSTEMS, 2000, 1762 : 13 - 30
  • [42] RFID data processing with a data stream query language
    Bai, Yijian
    Wang, Fusheng
    Liu, Peiya
    Zaniolo, Carlo
    Liu, Shaorong
    [J]. 2007 IEEE 23RD INTERNATIONAL CONFERENCE ON DATA ENGINEERING, VOLS 1-3, 2007, : 1159 - +
  • [43] Nested data structures in array frameworks
    Pivarski, Jim
    Lange, David
    Elmer, Peter
    [J]. 19TH INTERNATIONAL WORKSHOP ON ADVANCED COMPUTING AND ANALYSIS TECHNIQUES IN PHYSICS RESEARCH, 2020, 1525
  • [44] An advanced pictorial query language to query urban and rural data on GIS
    Rafanelli, Maurizio
    Ferri, Fernando
    Grifoni, Patrizia
    [J]. PROCEEDINGS OF THE SECOND IASTED INTERNATIONAL CONFERENCE ON HUMAN-COMPUTER INTERACTION, 2007, : 118 - +
  • [45] Subject and language-integrated Teaching at the University. Study into the Interplay of Content, Tasks and dialogical Learning Processes
    Drumm, Sandra
    [J]. DEUTSCH ALS FREMDSPRACHE-ZEITSCHRIFT ZUR THEORIE UND PRAXIS DES FACHES DEUTSCH ALS FREMDSPRACHE, 2021, 58 (01): : 59 - 60
  • [46] Astronomical data query language:: Simple query protocol for the virtual observatory
    Yasuda, N
    Mizumoto, Y
    Ohishi, M
    O'Mullane, W
    Budavári, T
    Haridas, V
    Li, N
    Malik, T
    Szalay, A
    Hill, M
    Linde, T
    Mann, B
    Page, C
    [J]. ASTRONOMICAL DATA ANALYSIS SOFTWARE AND SYSTEMS XIII, 2004, 314 : 293 - 295
  • [47] OPTIMUM - A QUERY LANGUAGE ALLOWING DATA MANIPULATION
    BUSCH, DD
    [J]. INTERFACE AGE, 1984, 9 (06): : 97 - 98
  • [48] Condensative stream query language for data streams
    School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh, United Kingdom
    不详
    [J]. Conf. Res. Pract. Inf. Technol. Ser, 2007, (113-122):
  • [49] LDQL: A Query Language for the Web of Linked Data
    Hartig, Olaf
    Perez, Jorge
    [J]. SEMANTIC WEB - ISWC 2015, PT I, 2015, 9366 : 73 - 91
  • [50] Linking Content and Language-Integrated Learning (CLIL) and Task-based Language Teaching (TBLT) in an effective way: a methodological proposal
    Lopes, Antonio
    [J]. ONOMAZEIN, 2020, : 5 - 22