<!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>Minimally-Intrusive Augmentation of Data Science Workflows</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Andreas M. Wahl</string-name>
          <email>andreas.wahl@fau.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Peter K. Schwab</string-name>
          <email>peter.schwab@fau.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Richard Lenz</string-name>
          <email>richard.lenz@fau.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Lehrstuhl fu ̈r Informatik 6 (Datenmanagement), FAU Erlangen-Nu ̈rnberg</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Data scientists follow individually established workflows and use customized tool chains to deal with complex data analysis scenarios. Novel tools, which aim to support their work, must not disrupt these proven technical environments and must integrate with their existing tool chains in order to further enhance their productivity. Augmenting data science workflows usually requires to explicitly load data sources into additional tools where they are processed in isolation and exported again for further usage. There is currently no evolvable mechanism to augment data science workflows with additional functionality without mandatory workflow disruption. To overcome this problem, we introduce a proxy driver for augmenting data science workflows. Our driver provides proxies of Java Database Connectivity (JDBC) objects and is easily evolvable through a plugin system. Driver instances can be synced with a remote plugin repository. Currently, two different driver plugins enable query-driven data ingestion as well as query-driven data profiling.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Data science workflows usually consist of multiple consecutive steps, including
data discovery, data exploration, data cleaning, model development, model
evaluation and result visualization. Data scientists use specialized tools for each
of these steps to overcome different challenges. They assemble customized tool
chains, in which data sources are passed along between these tools.
Augmenting such workflows currently requires integrating additional tools into these tool
chains, which can be time-consuming. However, many data science tools use
standardized database mechanisms such as Java Database Connectivity (JDBC) or
Open Database Connectivity (ODBC) to connect to the underlying data sources.
Hence, we argue that the database driver is a suitable extension point to
introduce additional functionality into data science workflows without requiring
significant workflow disruption.</p>
      <p>Contribution In this paper, we present the fundamentals of a JDBC driver for
augmenting data science workflows. We describe the overall driver architecture
and discuss evolvability as well as deployment aspects (Sec. 2). We illustrate the
benefits of our approach for data scientists by introducing two driver plugins
we have developed (Sec. 3). Our driver will soon be publicly available from
http://www.dormantdata.com.</p>
      <p>Wahl et al.</p>
    </sec>
    <sec id="sec-2">
      <title>Evolvable Database Driver</title>
      <p>Our driver provides proxies for objects of the Connection, Statement and
ResultSet classes of the JDBC API and wraps the native driver of the
respective data management system (Fig. 1). We use reflection techniques to augment
objects with additional logic at run time. This logic is encapsulated in
plugins, which are initialized when the proxy driver is loaded. Each plugin defines
which specific JDBC methods are intercepted and augmented. For each class,
the driver maintains a stack of plugins to enable complex augmentation. Plugins
are executed consecutively when calls to relevant JDBC methods are detected.
Evolvability Through our plugin system, JDBC objects can be augmented with
multiple layers of arbitrary logic. Plugins can define dependencies to other
plugins to enable the reuse of augmentation logic. To facilitate system evolvability,
local driver instances are synchronized with a remote plugin repository (Fig. 1).
Whenever the proxy driver is loaded, the repository is queried for updated
versions of previously used plugins to initiate automatic updates. Users are notified
about new plugins to decide whether to incorporate them into their workflow.
Deployment Effort Our driver is compatible with existing tools that use
JDBC to connect to underlying data management systems. Migrating to our
driver is minimally-intrusive: Users deploy the driver binary to their machine
and point their analysis tool to this binary (Fig. 1). This is done by adding the
prefix jdbc:dormantdata: to the connection string of the native driver.</p>
      <p>Proxy Driver</p>
      <p>Proxy
Connection
Invocation
Handler Stack</p>
      <p>Plugin 0</p>
      <p>...</p>
      <p>Plugin n</p>
      <p>Native
Connection</p>
      <p>Proxy
Statement
Invocation
Handler Stack</p>
      <p>Plugin 0</p>
      <p>...</p>
      <p>Plugin n
Native
Statement
Native Driver</p>
      <p>Proxy
ResultSet
Invocation
Handler Stack</p>
      <p>Plugin 0</p>
      <p>...</p>
      <p>Plugin n
Native</p>
      <p>ResultSet</p>
      <sec id="sec-2-1">
        <title>3.1 Query-Driven Data Ingestion</title>
        <p>
          The first plugin enables the automated ingestion of remote data sources
referenced in SQL queries. Data scientists can directly use the URL of data sources,
such as CSV files or HTML tables in the FROM-clauses of their queries. Our
evaluation indicates that they can work more efficiently with our plugin, as they are
able to perform data preparation tasks directly in the context of their actual
queries without having to use external ETL tools [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ].
        </p>
        <p>Plugin Logic The plugin intercepts calls to methods that execute SQL
statements (Fig. 2). After logging an intercepted query, it is parsed to extract all
references to data sources. Whenever an unknown or outdated data source is
detected, it is downloaded from its respective URL, transformed and stored in
the data management system. The query is subsequently rewritten to reference
the stored copy of the remote data source.</p>
        <p>Minimally-Intrusive Augmentation of Data Science Workflows
Intercept
Query</p>
        <p>Log
Query</p>
        <p>Parse
Query</p>
        <p>Extract Data
Source References</p>
        <p>Data Source
unknown or
outdated?
Yes
Download
Data Source</p>
        <p>No Rewrite</p>
        <p>Query</p>
        <p>Execute</p>
        <p>Query
Store Data
Source</p>
      </sec>
      <sec id="sec-2-2">
        <title>3.2 Query-Driven Data Profiling</title>
        <p>
          Through a second plugin, we provide support for analyzing query results in the
context of previous queries of the respective session [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]. We therefore integrate
data profiling algorithms into query processing. Among others, these algorithms
can derive basic statistics about the query results, find unique column
combinations and discover different types of constraints valid for the query results. The
plugin provides aggregated visualizations of the profiling results of the respective
session as well as measures to rank results according to their usefulness. This
allows data scientists to conduct targeted data exploration in the context of their
actual queries as well as plausibility assessment of intermediate query results.
Plugin Logic The plugin intercepts calls to methods that execute statements
and retrieve result rows from the underlying data management system. Parallel
to query processing, result rows are streamed to a remote server to avoid impact
of computationally expensive profiling on normal query processing. Result rows
are fed into an instance of the Metanome data profiling system [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. We
execute multiple data profiling algorithms on the result rows in parallel to generate
a selection of different data profiles. After ranking the data profiles according
to their deviation from the profiles of previous queries, the plugin launches a
companion dashboard next to the analysis tool from which queries are
formulated. The current query is displayed (Fig. 3; a), along with a visualization of
the previous query flow (Fig. 3; b). Branches indicate output schema changes.
Data scientists can freely choose which previous queries are used as reference
points during analysis. A query history (Fig. 3; c) allows inspecting previous
profiling results and visualizations. Suitable visualizations for the historic and
current results of each profiling algorithm are displayed (Fig. 3; d-i).
4
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>State of the Art</title>
      <p>
        In contrast to our approach, the technique of using a proxy driver has
previously only been used to add non-functional aspects to existing data
management systems and not for data science workflow augmentation. Among others,
these aspects include virtual clustering [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], transparent multi-tenancy [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], caching
techniques [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], virtual data integration [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and security mechanisms [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. System
evolvabilty is not addressed by previous efforts.
      </p>
      <p>
        There are several publicly available implementations of JDBC proxy drivers.
In contrast to our work, they either do not support all relevant parts of the API
(e.g. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]) or target specific purposes such as logging (e.g. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]) or virtual clustering
(e.g. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]). These implementations do also not address system evolvability.
      </p>
      <p>Wahl et al.</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion and Future Work</title>
      <p>Our JDBC proxy driver provides a minimally-intrusive way to augment data
science workflows with additional functionality. The currently implemented driver
plugins support data scientists with integrating and exploring unfamiliar data
sources. Our driver can also be a valuable tool for other researchers who are
monitoring existing data science workflows.</p>
      <p>
        We are currently extending our work by developing additional driver plugins.
These will provide functionality from existing research projects (cf. Sec. 4) as well
as novel context-sensitive auto-completion for SQL queries based on knowledge
mined from existing query logs (cf. [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]).
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. DSProxy, https://github.com/dapphub/ds-proxy,
          <source>accessed: 2018-05-29</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>HA-JDBC</surname>
          </string-name>
          , http://ha-jdbc.org/, accessed:
          <fpage>2018</fpage>
          -05-29
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. P6Spy, https://github.com/p6spy/p6spy, accessed:
          <fpage>2018</fpage>
          -05-29
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Cecchet</surname>
          </string-name>
          et al.:
          <string-name>
            <surname>C-JDBC</surname>
          </string-name>
          :
          <article-title>Flexible Database Clustering Middleware</article-title>
          . In: ATEC '
          <fpage>04</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Haller:
          <article-title>Tsunami - Anfrage-getriebene Anbindung von Datenquellen an ein Datenmanagementsystem</article-title>
          . In: INFORMATIK'
          <volume>17</volume>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. Lawrence:
          <article-title>Integration and virtualization of relational sql and nosql systems including mysql and mongodb</article-title>
          . In: CSCI'
          <volume>14</volume>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Lawrence</surname>
          </string-name>
          et al.:
          <article-title>Next Generation JDBC Database Drivers for Performance, Transparent Caching, Load Balancing, and Scale-out</article-title>
          .
          <source>In: SAC '17</source>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Ma</surname>
          </string-name>
          et al.:
          <article-title>A Transparent Data Middleware in Support of Multi-tenancy</article-title>
          . In: NWeSP'
          <volume>11</volume>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Mitropoulos</surname>
          </string-name>
          , Spinellis: SDriver:
          <article-title>Location-Specific Signatures Prevent SQL Injection Attacks</article-title>
          .
          <source>Computers and Security</source>
          <volume>28</volume>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Papenbrock</surname>
          </string-name>
          et al.:
          <article-title>Data Profiling with Metanome</article-title>
          .
          <source>PVLDB</source>
          <volume>8</volume>
          (
          <issue>12</issue>
          ) (
          <year>Aug 2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Wahl</surname>
          </string-name>
          et al.:
          <article-title>Query-Driven Knowledge-Sharing for Data Integration and Collaborative Data Science</article-title>
          . In: ADBIS'
          <volume>17</volume>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Wahl</surname>
          </string-name>
          et al.:
          <article-title>Query-Driven Data Profiling with OCEANProfile</article-title>
          . In: BIRTE'
          <volume>18</volume>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>