[ 
https://issues.apache.org/jira/browse/DRILL-2932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14527354#comment-14527354
 ] 

Daniel Barclay (Drill) edited comment on DRILL-2932 at 5/4/15 9:43 PM:
-----------------------------------------------------------------------

Patch commit message:

DRILL-2932: Fix:  Error reported via System.out rather than exception message
    
Main:
- Removed the System.out.println(...) from submissionFailed(...).
- Put UserException's message text in SQLException's message (didn't just wrap).
- Added undoing of extra wrapping by AvaticaStatement.execute...(...).
- Created unit test for execute...(...) exceptions.
- Refined related exception handling (handled cases separately, narrowed throws 
declarations and catches).
    
JDBC cleanup:
- Renamed ex -> executionFailureException
- Added getNext() method doc. comment.
- Removed some obsolete alignment spaces.
    
Added "review this" TODOs re DRILL-2933 (probably-obsolete 
SchemaChangeException):
- DrillCursor;
- MergingRecordBatch, ParquetResultListener, PrintingResultsListener, 
QueryWrapper, RecordBatchLoader, UnorderedReceiverBatch;
- TestDrillbitResilience, TestTextColumn, BaseTestQuery, DrillTestWrapper.



was (Author: dsbos):
Commit comment:

   DRILL-2932: Fix:  Error printed to System.out; text not in exception message.
    
    Main:
    - Removed the System.out.println(...) from submissionFailed(...).
    - Created unit test for execute...(...) exceptions.
    - Put UserException's message text in SQLException's message (didn't just 
wrap).
    - Added undoing of extra wrapping by AvaticaStatement.execute...(...).
    - Refined related exception handling (handled cases separately, narrowed
      throws declarations and catches).
    
    JDBC cleanup:
    - Renamed ex -> executionFailureException
    - Added getNext() method doc. comment.
    - Removed some obsolete alignment spaces.
    
    Added DRILL-2933 (SchemaChangeException) "review this" TODOs.
      - DrillCursor;
      - MergingRecordBatch, ParquetResultListener, PrintingResultsListener,
        QueryWrapper, RecordBatchLoader, UnorderedReceiverBatc;
      - TestDrillbitResilience, TestTextColumn, BaseTestQuery, DrillTestWrapper;


> Error text reported via System.out.println rather than thrown SQLException's 
> message
> ------------------------------------------------------------------------------------
>
>                 Key: DRILL-2932
>                 URL: https://issues.apache.org/jira/browse/DRILL-2932
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>            Reporter: Daniel Barclay (Drill)
>            Assignee: Daniel Barclay (Drill)
>            Priority: Critical
>
> There is a call to System.out.println(...) in 
> DrillResultSetImpl.ResultListener.submissionFailed(...):
>   System.out.println("Query failed: " + ex.getMessage());
> (That submissionFailed(...) is part of the implementation of 
> Statement.execute...(...) methods and ResultSet.)
> In SQLLine, this causes the exception message, which currently doesn't show 
> up otherwise in SQLLine, to show up when running SQLLine interactively.
> However, writing that to System.out. is completely inappropriate. 
> JDBC specifies that implementations throw SQLExceptions to report 
> errors\--implementations should not be unilaterally be deciding to write to 
> stdout\--or stderr.
>  
> Additionally, the text intended to reach the user is not copied into the 
> message of the SQLException that is thrown to the JDBC client.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to