[
https://issues.apache.org/jira/browse/CALCITE-6202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17806624#comment-17806624
]
Benchao Li commented on CALCITE-6202:
-------------------------------------
In {{SqlShell#main}}, we already have
{code:java}
try (PrintWriter err =
new PrintWriter(
new OutputStreamWriter(System.err, StandardCharsets.UTF_8));
InputStreamReader in =
new InputStreamReader(System.in, StandardCharsets.UTF_8);
PrintWriter out =
new PrintWriter(
new OutputStreamWriter(System.out, StandardCharsets.UTF_8))) {
new SqlShell(in, out, err, args).run();
} catch (Throwable e) {
e.printStackTrace();
}
{code}
The exception should be printed already, but it did not for now. I'll try to
figure out what's going firstly.
> `sqlsh` does not print error message when query fails
> -----------------------------------------------------
>
> Key: CALCITE-6202
> URL: https://issues.apache.org/jira/browse/CALCITE-6202
> Project: Calcite
> Issue Type: Improvement
> Components: os-adapter
> Affects Versions: 1.36.0
> Reporter: Benchao Li
> Assignee: Benchao Li
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.37.0
>
>
> For example, if we run following command:
> {code:bash}
> $ ./sqlsh "invalid SQL"
> {code}
> The query is obviously invalid, however it won't give any error messages. My
> proposal would be print the exception stack in stderr, it would be more easy
> to figure out what was wrong in the query.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)