XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: Metadata
    • Labels:
      None

      Description

      Currently Drill JDBC/ODBC driver implements its own prepared statement implementation, which basically issues limit 0 query to get the metadata and then executes the actual query. So the query is planned twice (for metadata fetch and actual execution). Proposal is to move that logic to server where we can make optimizations without disrupting/updating the JDBC/ODBC drivers.

      • PreparedStatement createPreparedStatement(String query). PreparedStatement object contains the following:
        • ResultSetMetadata getResultSetMetadata()
          • ResultsSetMetadata contains methods to fetch info about output columns of the query. What info these methods provide is given in this spreadsheet. It lists the ODBC/JDBC requirements and what Drill will provided through object ResultsSetMetadata.
          • Server can put more info here which is opaque to client and use it in server when the client sends execute prepared statement query request.

      Overload the current submit query API to take the PreparedStatement returned above.

      In the initial implementation, server side implementation of createPreparedStatement API is implemented as follows:

      • Runs the query with LIMIT 0, gets the schema
      • Convert the query into a binary blob and set it as opaque object in PreparedStatement.

      When the PreparedStatement is submitted for execution, reconstruct the query from binary blob in opaque component of PreparedStatement and execute it from scratch.

      Opaque component of the PreparedStatement is where we can save more information which we can use for optimizations/speedups.

      NOTE: We are not going to worry about parameters in prepared query in initial implementation. We can provide the functionality later if there is sufficient demand from Drill community.

      Changes in this patch are going to include protobuf messages, server side messages and Java client APIs. Native client changes are going to be tracked in a separate JIRA.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vkorukanti Venki Korukanti
                Reporter:
                vkorukanti Venki Korukanti
                Reviewer:
                Chun Chang
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: