Clone Tools
  • last updated 18 mins ago
Constraints: committers
Constraints: files
Constraints: dates
DRILL-4994: Add back JDBC prepared statement for older servers

When the JDBC client is connected to an older Drill server, it always

attempted to use server-side prepared statement with no fallback.

With this change, client will check server version and will fallback to the

previous client-side prepared statement (which is still limited to only execute

queries and does not provide metadata).

close #613

  1. … 19 more files in changeset.
DRILL-4730: Update JDBC DatabaseMetaData implementation to use new Metadata APIs

Update JDBC driver to use Metadata APIs instead of executing SQL queries

close #613

    • -14
    • +649
    • -0
    • +448
  1. … 13 more files in changeset.
DRILL-4994: Refactor DrillCursor

Refactor DrillCursor to be more self-contained.

    • -22
    • +301
DRILL-4969: Basic implementation of display size for column metadata

Add a simple implementation of display size, based on the ODBC table

available at:

closes #632

  1. … 5 more files in changeset.
DRILL-4369: Exchange name and version infos during handshake

There's no name and version exchanged between client and server over the User RPC


On client side, having access to the server name and version is useful to expose it

to the user (through JDBC or ODBC api like DatabaseMetadata#getDatabaseProductVersion()),

or to implement fallback strategy when some recent API are not available (like

metadata API).

On the server side, having access to the client version might be useful for audit

purposes and eventually to implement fallback strategy if it doesn't require a RPC

version change.

this closes #622

    • -0
    • +21
  1. … 18 more files in changeset.
DRILL-4950: Remove incorrect false condition; consume all empty batches

closes #621

DRILL-4880: Support JDBC driver registration using ServiceLoader

Support loading Drill driver using ServiceLoader. From the user perspective,

it means being able to use the driver without registering it first, like by using

Class.forName("org.apache.drill.jdbc.Driver") for example.

this closes #596

Change-Id: Id26922ee42bef5fbce46ac2bcbb83f1859e9bb48

    • -0
    • +1
  1. … 3 more files in changeset.
DRILL-4452: Uses Apache Calcite Avatica driver vs Optiq driver for Drill JDBC

Drill JDBC driver uses Optiq Avatica as its basis, but this dependency has

been moved over to Calcite, for quite some time without Drill code being

updated for it.

This patch updates Avatica version to the version from Calcite

(1.4.0-drill-r19). It also refactors Drill JDBC driver to comply with the

packages and API changes in Avatica. Finally it fixes the the SQL types for

lists and structs, since Drill doesn't support java.sql.Array and

java.sql.Struct interfaces.

this closes #395

Change-Id: Ia608adf900e8708d9e6f6f58ed41e104321a9914

    • -0
    • +477
  1. … 8 more files in changeset.
DRILL-4732: Update JDBC driver to use the new prepared statement APIs on DrillClient

this closes #532

  1. … 3 more files in changeset.
DRILL-3510: Add ANSI_QUOTES option so that Drill's SQL Parser will recognize ANSI_SQL identifiers

- added supporing of quoting identifiers with DOUBLE_QUOTES or BRACKETS via setting new

sys/sess EnumString option QUOTING_IDENTIFIERS;

- added possibility of setting QUOTING_IDENTIFIERS by the jdbc connection URL string;

- added relevant unit tests;

close #520

  1. … 19 more files in changeset.
DRILL-4184: Support variable length decimal fields in parquet

  1. … 68 more files in changeset.
DRILL-4382: Remove dependency on drill-logical from vector package

  1. … 80 more files in changeset.
DRILL-3987: (CLEANUP) Final cleanups to get complete working build/distribution

- small cleanups

- move Hook to drill-adbc

- update distribution assembly to include new modules

This closes #250

  1. … 30 more files in changeset.
DRILL-3927: use OutOfMemoryException in more places Some code cleanup required for the upcoming introduction of the rewritten direct memory allocator. Chiefly the introduction of OutOfMemoryException handling in a few spots, the use of DrillAutoCloseables for some allocator close() calls, and some other minor cleanup. - removed the exclusion of exec/work from the jdbc-all jar, because it now depends on OutOfMemoryException, and that is derived from FragmentSetupException and Foreman Exception

this closes #199

  1. … 14 more files in changeset.
DRILL-3766: Fix ResultSet.getRow() (make 1-based; return 0 at end).

Corrected for Avatica's non-JDBC-compliant behavior.

Also purged unused imports.

  1. … 1 more file in changeset.
DRILL-3778: Add missed part of DRILL-3160 (making JDBC Javadoc available).

This closes #158


Configured Javadoc generation (title, package groups, version in headers).

Added link to JDBC page in Drill documentation site.

Edited/fixed some JDBC Javadoc comments.

Added explicit SQLConversionOverflowException to throws clauses for Javadoc


Added some imports for Javadoc references.


Fixed a couple Javadoc syntax errors.

Fixed POM indentation.

    • -18
    • +30
    • -2
    • +8
  1. … 3 more files in changeset.
DRILL-3661: Update: Added a @link and a @code.

This closes #119

DRILL-3661: Update: Fixed "DRILL-xxxx" reference.

DRILL-2769: Fix most non-SQLException not-supported-yet exceptions.


Added (auto-scanning) unit test. [Drill2769UnsupportedReportsUseSqlExceptionTest]

Added translation of lots of UnsupportedOperationExceptions (and some

RuntimeExceptions) from Avatica code to SQLFeatureNotSupportedExceptions (tons

of method overrides).


Added explicit bounds checks in ResultSetMetaData methods and checking of

last-accessed column in DrillAccessorList.wasNull() (to fix other

RuntimeExceptions to SQLExceptions).

Added resetting of last-accessed column to fix latent bug in DrillAccessorList.


- Renamed some zero-based index/ordinal-position parameters to "...Offset".

- Renamed some one-based index/ordinal-position parameters to "...Number".

- Renamed DrillAccessorList lastColumn to rowLastColumnOffset; declared

explicit logical null value for rowLastColumnOffset.

  1. … 1 more file in changeset.
DRILL-2489: Throw exception from remaining methods for closed JDBC objects.

Refactored unit test to check all methods per interface. (Replaced individual,

static test methods with bulk reflection-based checking.)


Added DrillResultSetMetaDataImpl.

Added method overrides to check state for remaining methods from Connection,

Statement, PreparedStatement, ResultSet, ResultSetMetaData and DatabaseMetaData.


- renamed checkNotClosed to throwIfClosed.

    • -0
    • +198
  1. … 4 more files in changeset.
DRILL-3661: Edit JDBC doc. for clarity, more consistency, bug fixes.

Also fixed two serialVersionUID literals.

    • -11
    • +22
    • -2
    • +4
    • -2
    • +2
  1. … 13 more files in changeset.
DRILL-3589: Update JDBC driver to shade and minimize dependencies.

Update build process to use shading, stop using Proguard.

Add simple integration test that verifies that the JDBC driver works

correctly with a clean classpath.

    • -10
    • +4
  1. … 9 more files in changeset.
DRILL-3347: VARCHAR ResultSet.getObject returned, not String.

this closes #144

Core fix:

- Fixed {,Nullable}VarCharAccessor's getObject() to return String instead of

value vector's internal

- Updated unit tests (to expect only String now).

[DatabaseMetaDataGetColumnsTest, ResultSetMetaDataTest]

Also Added getObject check in tracing proxy test. [TracingProxyDriverTest]

Changed hard references to Hadoop's Text and JodaTime's Period to strings in

warning check in tracing proxy. [InvocationReporterImpl]


- Added @Override annotations. [SqlAccessors]

- (Unintentionally) fixed (undetected) missing comma. [ValueVectorTypes.tdd]

    • -0
    • +2
  1. … 5 more files in changeset.
DRILL-3598: use a factory to create the root allocator. - made the constructor for TopLevelAllocator package private to enforce this

Delete a test that had been commented out for over a year, it no longer compiles due to interface changes and there is plenty of other testing for hash aggregate.

  1. … 43 more files in changeset.
DRILL-3566: Fix: PreparedStatement.executeQuery() got ClassCastException.


Restored DrillResultSetImpl(...)'s statement parameter from overly

restrictive DrillStatementImpl to AvaticaStatement and removed caller

cast that was throwing. (Relatedly, adjusted getStatement() and moved

internal casting from statement to connection.)

Added basic test of querying via PreparedStatement. [PreparedStatementTest]

Added some case test of statement-creation methods. [ConnectionTest]

Removed now-unneeded DrillPrepareResult cast.

Eliminated redundant getConnection() and getClient calls, intermediate variables, etc.

Fixed comment error.

this closes #143

  1. … 3 more files in changeset.
DRILL-3153: Fix JDBC's getIdentifierQuoteString() to report Drill's backquote.

Added override of Avatica's default implementation returning SQL

standard value. Added Javadoc. Added unit test.

Also moved unit test for nullsAreSortedXxx methods.

DRILL-3153: Update: Comment fixes and whitespace only.

Close apache/drill#99

  1. … 2 more files in changeset.
DRILL-3151: Fix many ResultSetMetaData method return values.

Added ~unit test for ResultSetMetaData implementation.

Made getObject return classes available to implementation of getColumnClassName:

- Added SqlAccessor.getObjectClass() (to put that metadata right next to code

to which it corresponds rather than in far-away parallel code).

- Added similar AvaticaDrillSqlAccessor.getObjectClass().

- Changed DrillAccessorList.accessors from Accessor[] to

AvaticaDrillSqlAccessor[] for better access to JDBC getObject return class.

- Extracted return classes from accessors to pass to updateColumnMetaData.

Reworked some data type mapping and utilities:

- Added Added Types.getSqlTypeName(...).

- Renamed Types.getJdbcType(...) to getJdbcTypeCode(...)

- Replaced Types.isUnSigned with isJdbcSignedType.

- Fixed various bogus RPC-type XXX -> java.sql.Types.SMALLINT mappings.

- Removed DrillColumnMetaDataList.getJdbcTypeName.

- Moved getAvaticaType up (for bottom-up order).

- Revised DrillColumnMetaDataList.getAvaticaType(...).


- Updated updateColumnMetaData(...) to change many calculations of metadata

input to ColumnMetaData construction. [DrillColumnMetaDataList]

Updated other metadata tests per changes.

  1. … 11 more files in changeset.
DRILL-2494: Have PreparedStmt. set-param. methods throw "unsupported".

Added (integration-level) unit test.

Modified set-parameter methods to throw SQLFeatureNotSupportedException.

(Intercepted common getParameter method.)

Inserted DrillPreparedStatement into hierarchy for place for documentation.

Documented that parameter-setting methods are not supported.

  1. … 1 more file in changeset.
DRILL-3285: Part 3--Invert beforeFirstBatch -> ! afterFirstBatch.

DRILL-3285: Part 2--Renaming.

Renamed state/control-flow members:

- started -> initialSchemaLoaded

- first -> beforeFirstBatch

- redoFirstNext -> returnTrueForNextCallToNext

- finished -> afterLastRow

Renamed other items:

- changed -> schemaChanged

- currentBatch -> currentBatchHolder

- DrillResultSet's currentBatch -> batchLoader