Clone Tools
  • last updated 24 mins ago
Constraints: committers
Constraints: files
Constraints: dates
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

DRILL-3285: Part 4--Reorder fields, updateColumns.

DRILL-3285: Part 1--Prep., Hygiene: Mainly, adding comments.

Added/edited comments:

- field doc. comments

- method doc. comments

- branch/block comments

Removed unused recordBatchCount and getRecordBatchCount().

Added logger call for spurious batch.

Various cleanup:

- Cleaned up logger.

- Added "final" on updateColumns().

- Wrapped some lines

- Misc. comment whitespace.

DRILL-3285: Part 5--Split old hacky next() into separate methods.

Split the original public next() method (which was hacked to handle an extra,

initial call to read the schema batch) into:

- new loadInitialSchema() (for handling the call for the schema)

- modified next() (for handling normal calls from

- new private nextRowInternally() (for common code)

Pulled invariant afterFirstBatch up out of bogus-batch loop.

DRILL-3262: Rename DrillDatabaseMetaData -> DrillDatabaseMetaDataImpl.

Renamed org.apache.drill.jdbc.impl.DrillDatabaseMetaData to

org.apache.drill.jdbc.impl.DrillDatabaseMetaDataImpl (re creating

org.apache.drill.jdbc.DrillDatabaseMetaDataImpl for DRILL-3198).

[DrillDatabaseMetaData -> DrillDatabaseMetaDataImpl, DrillJdbc41Factory]

    • -0
    • +118
DRILL-3198: Fix: DatabaseMetaData.getTypeInfo(...), etc., return null.

Fixed DatabaseMetaData.getTypeInfo(...) and similar methods enough to not return

null. (Each method now returns a ResultSet representing a result set with zero

rows, though not with JDBC-specified columns.)

- Changed utility method getEmptyResult().

- Added basic test methods.

- Added interface DrillDatabaseMetaData (for place to document current

Drill-specific behavior).

- Added Javadoc for current behavior.

    • -1
    • +2
    • -5
    • +15
  1. … 1 more file in changeset.
DRILL-3216: Part 2--Fix existing(+) INFORMATION_SCHEMA.COLUMNS columns.

Added unit test. [TempInformationSchemaColumnsTest]


- Changed -1 to NULL.

- Moved column NUMERIC_PRECISION to correct position.

- Fixed column ORDINAL_POSITION from 0-based to 1-based.

- Moved CHAR length to column CHARACTER_MAXIMUM_LENGTH.


- Added precision and scale values for integer types and floating-point types.

- Added column COLUMN_DEFAULT.



- Added column INTERVAL_TYPE.


- Fixed column DATA_TYPE to correct form of type names:


- short (e.g., "CHAR") to specified (e.g., "CHARACTER")

Applied COLUMNS to JDBC DatabaseMetaData.getColumns() implementation:

- Changed some getColumns() result values:

- type names (DATA_TYPE changes)

- precision radix for some cases

- Adapted existing uses of COLUMNS data.

- Applied new COLUMNS data (e.g., interval precision).

- Updated getColumns() test (re changed result values).

- Augmented getColumns() test (e.g., more intervals).

Updated other tests using INFORMATION_SCHEMA.COLUMNS:

- -1 -> NULL

- integer types have precision and scale values

- "CHAR" -> "CHARACTER", etc.

[TestInfoSchema, TestInfoSchemaOnHiveStorage, TestInformationSchemaColumns,


    • -214
    • +122
  1. … 8 more files in changeset.
DRILL-3216: Part 1--Pre-core code hygiene.

Many-instance changes: [DatabaseMetaDataGetColumnsTest]

- Renamed "...opt..." columns and methods to match "...mdrOpt" variables.

- Renamed "...req..." columns and methods to match "...mdrReq" variables.

- Renamed "testRow..." variables to "mdrUnk".

- Added/applied getIntOrNull(...) especially to simplify null cases.

- Put REAL, FLOAT, and DOUBLE in that order (smallest, ~variable, largest).

- (Edited "nullability code" -> "nullability code:".)

Renamed "type" -> "relDataType"; "sqlType" -> "sqlTypeName".

Changed "dfs_test.tmp" -> VIEW_SCHEMA.

Re-aligned query SQL.

Added 2 "final".

Edited 3253 (test plugin) TODOs.

Purged several comments.

Wrapped some lines.

    • -9
    • +11
  1. … 2 more files in changeset.
DRILL-3159: Part 1--Prep., Hyg. for: Make JDBC throttling threshold configurable.

Cleaned, enhanced DrillResultSet:

- Enhanced ResultsListener logging:

- Added instance ID; added batch numbers.

- Added logging at close (pairing with logging at construction).

- Fixed 2-integer query ID to UUID form.

- Renamed qrb -> qdb; q -> qdb (per recent QueryDataBatch change).

- Added "final" on ResultsListener's logger.

Reduced Avatica-vs.-Drill casting:

- DrillStatementImpl's (Drill)Connection(Impl).

- DrillResultSetImpl's (Drill)Statement(Impl).

Converted a comment in ExecConstants.

  1. … 1 more file in changeset.
DRILL-3159: Part 2--Core: Make JDBC throttling threshold configurable.

Added configuration/option "drill.jdbc.batch_queue_throttling_threshold".

Applied "drill.jdbc.batch_queue_throttling_threshold" to DrillResultSetImpl.

  1. … 2 more files in changeset.
DRILL-3034: Apply UserException to port-binding; handle in embedded-Drill case.

Applied UserException to can't-bind-to-port error. [BasicServer]

Added specific handling of UserException (above case or other) in SQLException

wrapping. [DrillConnectionImpl]

  1. … 1 more file in changeset.
DRILL-3020: Copy cause exception's message to thrown SQLException's message.

Changed SQLException construction to set SQLException's message to the cause

exception's toString().


- Narrowed one SQLException to SQLNonTransientConnectionException (not other

two, since unclear whether transient, non-transient, or varied).

- Clarified/simplified exception messages.

- Fixed message typo.

    • -2
    • +2
DRILL-2993: Unthrottle at cancel() to fix post-cancelation hangs.

Added unthrottling in close().

Cleaned up throttling logic code:

- Applied AtomicBoolean to eliminate race conditions.

- Extracted methods for starting/stopping throttling.

Made small edits to some message:

- Fixed missed, inconsistent ResultsListener log messages.

- Clarified exception message.

DRILL-2755: Use and handle InterruptedException during query processing.

- Interrupt FragmentExecutor thread as part of FragmentExecutor.cancel()

- Handle InterruptedException in ExternalSortBatch.newSV2(). If the fragment status says

should not continue, then throw the InterruptedException to caller which returns IterOutcome.STOP

- Add comments reg not handling of InterruptedException in SendingAccountor.waitForSendComplete()

- Handle InterruptedException in OrderedPartitionRecordBatch.getPartitionVectors()

If interrupted in Thread.sleep calls and fragment status says should not run, then

return IterOutcome.STOP downstream.

- Interrupt partitioner threads if PartitionerRecordBatch is interrupted while waiting for

partitioner threads to complete.

- Preserve interrupt status if not handled

- Handle null RecordBatches returned by RawBatchBuffer.getNext() in MergingRecordBatch.buildSchema()

- Change timeout in Foreman to be proportional to the number of intermediate fragments sent instead

of hard coded limit of 90s.

- Change TimedRunnable to enforce a timeout of 15s per runnable.

Total timeout is (5s * numOfRunnableTasks) / parallelism.

- Add unit tests

* Testing cancelling a query interrupts the query fragments which are currently blocked

* Testing interrupting the partitioner sender which in turn interrupts its helper threads

* Testing TimedRunanble enforeces timeout for the whole task list.

  1. … 28 more files in changeset.
DRILL-2961: Part 2--Core: Have set...Timeout methods throw rather than ignore.

Changed implementation of Statement.setQueryTimeout(...) and

Connection.setNetworkTimeout(...) to throw SQLFeatureNotSupportedException

rather than silently not setting timeout.


- Added implementations of Statement.{set,get}QueryTimeout(...) and

Connection.{set,get}NetworkTimeout(...) methods (in classes

DrillStatementImpl, DrillConnectionImpl).

- Added Drill-specific narrowed declarations and documentation (in

interfaces DrillStatement and DrillConnection).

- Added unit tests (in new StatementTest, ConnectionTest).

Narrowed other thrown exceptions to allow narrowing in above methods:

- Narrowed exceptions on isClosed() and checkNotClosed() (in

DrillConnectionImpl, DrillStatementImpl).

- Added InvalidParameterSqlException.

    • -0
    • +38
    • -0
    • +86
  1. … 2 more files in changeset.
DRILL-2961: Part 1--Prep., Hyg.: Split DrillStatement -> DrillStatement{,Impl}.

Preparation for query/network timeout methods:

- Moved class ...jdbc.DrillStatement to ...jdbc.impl.DrillStatementImpl.

- Created interface ...jdbc.DrillStatement interface, extending

java.sql.Statement (for place for Drill-specific narrowed declarations and

documentation). Declared DrillStatementImpl to implement new DrillStatement.

- Updated references.

- Adjusted visibility (temporarily make somethings publich until DRILL-2089 is

done more).

Misc. code hygiene:

- Purged extraneous imports of ResultSet.

- Purged TODO made obsolete by UserException.

- Misc. whitespace.

    • -102
    • +12
    • -0
    • +123