<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Bridging the Gap between Data Lakes and RDBMSs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Eficient Query Processing with Parquet</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Supervised by Prof. Dr. Thomas Neumann Technical University of Munich</institution>
          ,
          <addr-line>Boltzmannstraße 3, 85748 Garching</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In the age of massive data, databases are getting less convenient for data exploration tasks due to the costly loading phase. Still, the highly optimized query engines of database systems are greatly beneficial for the performance of data analysis tasks. With our research, we want to bridge this gap and provide paramount analytical performance without the need of static data loading. Our approach enables the integration of Parquet files - one of the most used columnar file format in the data lake context - into the data processing pipeline of a database system in a convenient way. We allow end-users to benefit from the database system performance without a costly and time-consuming loading phase.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Parquet</kwd>
        <kwd>Data Lakes</kwd>
        <kwd>Dremel</kwd>
        <kwd>Database Systems</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Published in the Proceedings of the Workshops of the EDBT/ICDT 2024
Joint Conference (March 25-28, 2024), Paestum, Italy</p>
      <p>© 2024 Copyright for this paper by its authors. Use permitted under Creative Commons License
CPWrEooUrckReshdoinpgs IhStpN:/c1e6u1r3-w-0s.o7r3g ACttEribUutRion W4.0oInrtekrnsahtioonpal (PCCroBYce4.0e).dings (CEUR-WS.org)</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <sec id="sec-2-1">
        <title>We identified two main areas of related work that are relevant for our work: (i) Processing raw data in RDBMSs and (ii) processing nested data. In the following, we categorize the collected related work by these two areas.</title>
        <sec id="sec-2-1-1">
          <title>2.1. Processing of Raw Data</title>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>There exists a multitude of work on processing CSV files.</title>
        <p>
          For example, Mühlbauer et al. [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] present techniques to
directly query the row-wise non-binary format in an
eficient way by reading the file in chunks with vectorization
methods. Furthermore, Alagiannis et al. [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] present
approaches to compensate for the missing metadata inside
CSV files by utilizing the statistics routines of Postgres
to optimize their selectivity estimates. Similarly to their
CSV scanner, we collect statistics and metadata tailored
to the Parquet file format.
        </p>
        <p>
          Apache Arrow, an in-memory columnar format, was
used as a foundation for the storage layer of a DBMS in
the work of Li et al. [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. They focused on good OLTP
performance by utilizing a relaxed Apache Arrow format
while supporting a fast export to data science engines. Liu
et al. [7] provide an overview of how columnar formats
can be utilized as a base for DBMSs. They compare three
major formats, Parquet, Arrow, and ORC, under
diferent aspects like compression performance, transcoding
throughput, and their performance for diferent database
operations like projection or filtering. Zeng et al. [ 8]
compare the layout of Parquet and ORC under
diferent aspects. They do not find a clear winner but focus
more on how future formats can learn from their findings.
Both papers, highlight Parquet as one of the standards
for columnar data formats.
        </p>
        <sec id="sec-2-2-1">
          <title>2.2. Processing of Nested Data</title>
        </sec>
      </sec>
      <sec id="sec-2-3">
        <title>Durner et al. [9] present with their work on JSON tiles an</title>
        <p>approach to eficiently process JSON files. They also face
the challenge of nested data and tackle it by extracting
common schema parts and materializing them into a
columnar format. Robust parallelization. We aim for optimal
perfor</p>
        <p>Wang et al. [10] present Steed, a native database system mance independent of how the utilized Parquet writer
designed for tree-structured data. They built a row and a distributed the data over the Parquet levels (Row Groups
columnar data layout to store JSON data. For the column and Pages) and for which granularity statistics were
coldata, they utilize the Dremel schema. They suggest opti- lected and stored in the Parquet file. Some Parquet file
mizing for simple accesses with at most one array along writers that write significantly more rows into one row
the access path, so fewer nodes must be visited. group than what we consider a good number of rows that</p>
        <p>Trance, presented by Smith et al. [11], is a framework should be processed as one batch [12, 13].Hence, we deal
that transfers queries that run on nested collections to with this situation by parallelizing below row group level
a set of relational queries that can run on flattened col- which we visualize in Figure 1 with the threads T1 - T4,
lections. They introduce a “fully-flattened” data repre- where each row group is processed by two threads in
sentation, whereas the Dremel encoding stores the data parallel. While scanning a single batch, we scan as little
“semi-flattened”. data as possible. First, we only scan the columns that are</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Current Work</title>
      <sec id="sec-3-1">
        <title>In this section, we start by discussing the work we have</title>
        <p>already completed. Afterwards, we explain our current
work. As a first step, we focused on eficiently scanning
Parquet files without any nested types. In the second step,
which we are working on, we look into adding support
for nested types. This support will be added orthogonally
so that we are not forced to rewrite our scanner entirely
and keep the complexity of nested types outside of the
scanner implementation.</p>
        <sec id="sec-3-1-1">
          <title>3.1. Eficient Processing of Parquet Files</title>
          <p>The main challenge of building an eficient Parquet
Scanner is to handle the broad variety of potential input file
structures. Parquet files are first split horizontally into
row groups with an arbitrary number of rows. Each row
group is then stored column-wise in so-called column
chunks. The data is split per column chunk into one or
more pages with an arbitrary number of values per page
using one of the many diferent supported encodings and
compressions. Such files can be created by diferent
Parquet writers with diferent settings, leading to arbitrarily
diferent files. In our example in Figure 1, the Parquet file
contains three columns (x, y, and z) and is split into two
row groups. The column chunks inside the row groups
are split into one to three pages.
required for producing the query result, columns x and 3.2. Dedremelize Parquet Files
z in our example. This optimization can be easily
realized since Parquet stores the data in a columnar format. We consider the handling of nested data an orthogonal
Hence, columns can be accessed independently, which problem to an eficient Parquet scanner. Therefore, we
ifts quite nicely into a columnar engine like Umbra [ 13]. investigate that topic based on the assumption that the
underlying database system already supports scanning</p>
          <p>Multi-level pruning. Suppose we have to evaluate Parquet files with basic types.
selection predicates on specific columns; we can use these Relational database systems are optimized for
nonpredicates in two phases to minimize the data we have nested data, specifically in third normal form. The
to access. First, we use them to exclude files, row groups, Dremel encoding allows Parquet files to store nested data
and pages as early as possible. In our example in Figure 1, in a columnar way. Basic fields are stored in their own
we have a selection predicate for column x with whom columns, and the so-called repetition levels tell us later
we can exclude in each row group one entire page. how the nested structure can be rebuilt using an
automa</p>
          <p>
            Since min/max statistics are specified as optional fields ton presented in the Dremel encoding paper [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ].
Interin the Parquet format, we can not rely on them. There- estingly, elements from the same nesting level with the
fore, we added fallback min/max statistics, which we call same parent have the same repetition level [15]. Based
synopses. To keep the number of synopses fixed, we store on this finding, we can group columns by this condition
them on row group level and group multiple row groups (grouped column sets) and end up with a set of tables in
together if the Parquet file contains many row groups. the third normal form.
          </p>
          <p>The second phase, where we use the predicates to min- If we postpone the reconstruction of the nesting to
imize the scanned data, is during the actual data loading. a later stage, we can split the scan of nested data into
We start by loading the columns that are restricted by the multiple scans that can be performed individually on the
predicates and evaluate them with vectorized functions. grouped column sets from above. Based on the repetition
In Figure1, we do that for column x. Then, we only access levels, we can generate what we call surrogate keys that
the rest of the columns, in our example column y, if the allow us to later join the diferent levels back together. We
predicate holds for the specific row. will publish more details on that in the future, addressing
all the requirements and showing performance results.</p>
          <p>On-the-fly statistics computation. Even with those
parallelization and pruning techniques, we observed Benchmarks for nested data. Finding
approprisignificant performance diferences for more complex ate benchmarks is very challenging since nested data
queries that are ran on Parquet files instead of their na- can be very versatile. The number of nesting
levtive database relation equivalents. Due to some Parquet els and the children-to-parent ratio can vary
signifiifles lacking statistics entirely and only basic min/max cantly. We identified two resources for benchmarks:
statistics being available in the rest of the Parquet files, we Firstly, there exists work on benchmarking big data
decided to compute our own set of statistics for each col- systems using a modified version of the TPC-H
benchumn inside a Parquet file whenever they are accessed for mark that nests lineitems into the corresponding
the first time. We compute HyperLogLog sketches [ 14] orders [16] and even the orders into the
correspondand keep a random data sample. We keep the overhead ing customers [11]. The downside of nesting the TPC-H
of the statistics computation low by not accessing the dataset is that one of the benchmark’s key challenges,
data unnecessarily. We only write such statistics when the join performance, is at an advantage since the data
scanning the data for query evaluation. Starting with the is already grouped by the primary key/foreign key join
second time the file is accessed, our query optimizer can predicates.
work with these statistics to generate query plans that Second, there exists work on benchmarking other
are as optimized as for standard database tables. nested file formats like JSON and XML [ 9, 17, 18]. The</p>
          <p>Based on the statistics and information from the query downside of these benchmarks is that they were designed
plan, we also try to estimate the primary keys of each file to highlight the performance bottlenecks that those file
which help us decide if we have a primary key/foreign formats introduce, like the unknown schema and the
key join. Based on the usage of the columns and distinct reading from a non-binary file format. In addition, they
value estimates, we check if single columns and pairs of were not designed to be used for big data workloads
columns could be primary key candidates. but for data sizes that are still manageable in a
human</p>
          <p>Our experiments show that combining all these tech- readable format. Scaling those benchmarks up to achieve
niques enables us to process Parquet files very eficiently big data scale is not always possible. DeepBench [19] is
and achieve similar performance compared to data stored an extensible and scalable benchmark for JSON data
foin traditional database relations. In addition, we can out- cusing on diferent nesting levels and array types which
perform other existing systems that support querying could be extended to Parquet since it is targeting similar
Parquet files directly. bottlenecks. We will evaluate these benchmarks and
microbenchmarks in the future to get a better understanding fast transactional workloads on universal columnar
of their capabilities and limitations. data file formats, VLDB 14 (2020) 534–546.
[7] C. Liu, A. Pavlenko, M. Interlandi, B. Haynes, A
deep dive into common open formats for analytical
4. Future Work dbmss, VLDB 16 (2023) 3044–3056.
[8] X. Zeng, Y. Hui, J. Shen, A. Pavlo, W. McKinney,
Our current work already discusses how Parquet scan- H. Zhang, An empirical evaluation of columnar
ning capabilities can be integrated into database engines. storage formats, VLDB 17 (2023) 148–161.
In the real world, extensions for Parquet files and other [9] D. Durner, V. Leis, T. Neumann, JSON tiles: Fast
columnar storage formats make file-based storage for- analytics on semi-structured data, in: SIGMOD
mats even more powerful. Well-known extensions are Conference, 2021, pp. 445–458.
Iceberg [20] and Deltalake [21]. They allow schema evo- [10] Z. Wang, S. Chen, Exploiting common patterns for
lution, support updates as deltas or full rewrites, and even tree-structured data, in: SIGMOD Conference, 2017,
support time travel to earlier versions. In the future, we pp. 883–896.
plan to investigate how the aforementioned extensions [11] J. Smith, M. Benedikt, M. Nikolic, A. Shaikhha,
Scalalign with the capabilities of a database engine and how able querying of nested data, VLDB 14 (2020) 445–
these can be integrated seamlessly into existing systems. 457.
[12] V. Leis, P. A. Boncz, A. Kemper, T. Neumann,
5. Conclusion Morsel-driven parallelism: a numa-aware query
evaluation framework for the many-core age, in:
We presented our investigations on how the gap between SIGMOD Conference, 2014, pp. 743–754.
highly eficient relational database systems and data lake [13] T. Neumann, M. J. Freitag, Umbra: A disk-based
ifle formats can be bridged. We started with a Parquet system with in-memory performance, in: CIDR,
scanner that shows how these files can be seamlessly 2020.
integrated into the stack of a relational database engine. [14] P. Flajolet, É. Fusy, O. Gandouet, F. Meunier,
HyperOur current work focuses on supporting nested data, a loglog: the analysis of a near-optimal cardinality
common pattern in big data workloads. The goal is to estimation algorithm, in: Discrete Mathematics and
keep the implementation efort and complexity as low as Theoretical Computer Science, 2007, pp. 137–156.
possible. In addition, we want to abstract as much logic [15] S. Melnik, A. Gubarev, J. J. Long, G. Romer, S.
Shivaway from the core database engine as possible. The first akumar, et al., Dremel: A decade of interactive SQL
measurements show promising results, proving that our analysis at web scale, VLDB 13 (2020) 3461–3472.
vision of a clean, easy-to-implement addition does not [16] P. Pirzadeh, M. J. Carey, T. Westmann, A
perforcontradict competitive performance. mance study of big data analytics platforms, in:
IEEE BigData, 2017, pp. 2911–2920.
[17] A. Schmidt, F. Waas, M. L. Kersten, M. J. Carey,
References I. Manolescu, R. Busse, Xmark: A benchmark for
XML data management, in: VLDB, 2002, pp. 974–
985.
[18] C. Truica, E. S. Apostol, J. Darmont, T. B. Pedersen,</p>
          <p>The forgotten document-oriented database
management systems: An overview and benchmark of
native XML dodbmses in comparison with JSON
dodbmses, Big Data Res. 25 (2021) 100205.
[19] S. Belloni, D. Ritter, M. Schröder, N. Rörup,
Deepbench: Benchmarking JSON document stores, in:</p>
          <p>DBTest@SIGMOD, 2022, pp. 1–9.
[20] Apache Software Foundation, Apache iceberg, 2013.</p>
          <p>URL: https://iceberg.apache.org.
[21] M. Armbrust, T. Das, S. Paranjpye, R. Xin, S. Zhu,
et al., Delta lake: High-performance ACID table
storage over cloud object stores, VLDB 13 (2020)
3411–3424.</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Apache</given-names>
            <surname>Software</surname>
          </string-name>
          <string-name>
            <surname>Foundation</surname>
          </string-name>
          , Apache parquet,
          <year>2013</year>
          . URL: https://parquet.apache.org.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Rey</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Freitag</surname>
          </string-name>
          , T. Neumann,
          <article-title>Seamless integration of parquet files into data processing</article-title>
          ,
          <source>in: BTW</source>
          , volume P-
          <volume>331</volume>
          <source>of LNI</source>
          ,
          <year>2023</year>
          , pp.
          <fpage>235</fpage>
          -
          <lpage>258</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Melnik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gubarev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. J.</given-names>
            <surname>Long</surname>
          </string-name>
          , G. Romer,
          <string-name>
            <given-names>S.</given-names>
            <surname>Shivakumar</surname>
          </string-name>
          , et al.,
          <source>Dremel: Interactive analysis of webscale datasets, VLDB</source>
          <volume>3</volume>
          (
          <year>2010</year>
          )
          <fpage>330</fpage>
          -
          <lpage>339</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>T.</given-names>
            <surname>Mühlbauer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Rödiger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Seilbeck</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Reiser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kemper</surname>
          </string-name>
          , T. Neumann,
          <article-title>Instant loading for main memory databases</article-title>
          ,
          <source>VLDB</source>
          <volume>6</volume>
          (
          <year>2013</year>
          )
          <fpage>1702</fpage>
          -
          <lpage>1713</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>I. Alagiannis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Borovica</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Branco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Idreos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ailamaki</surname>
          </string-name>
          ,
          <article-title>Nodb: eficient query execution on raw data files</article-title>
          ,
          <source>in: SIGMOD Conference</source>
          ,
          <year>2012</year>
          , pp.
          <fpage>241</fpage>
          -
          <lpage>252</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>T.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Butrovich</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ngom</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W. S.</given-names>
            <surname>Lim</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>McKinney</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pavlo</surname>
          </string-name>
          , Mainlining databases: Supporting
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>