Search in sources :

Example 6 with SqlClientException

use of org.apache.flink.table.client.SqlClientException in project flink by apache.

the class CliOptionsParser method parseEmbeddedModeClient.

// --------------------------------------------------------------------------------------------
// Line Parsing
// --------------------------------------------------------------------------------------------
public static CliOptions parseEmbeddedModeClient(String[] args) {
    try {
        DefaultParser parser = new DefaultParser();
        CommandLine line = parser.parse(EMBEDDED_MODE_CLIENT_OPTIONS, args, true);
        return new CliOptions(line.hasOption(CliOptionsParser.OPTION_HELP.getOpt()), checkSessionId(line), checkUrl(line, CliOptionsParser.OPTION_INIT_FILE), checkUrl(line, CliOptionsParser.OPTION_FILE), checkUrls(line, CliOptionsParser.OPTION_JAR), checkUrls(line, CliOptionsParser.OPTION_LIBRARY), line.getOptionValue(CliOptionsParser.OPTION_UPDATE.getOpt()), line.getOptionValue(CliOptionsParser.OPTION_HISTORY.getOpt()), getPythonConfiguration(line));
    } catch (ParseException e) {
        throw new SqlClientException(e.getMessage());
    }
}
Also used : CommandLine(org.apache.commons.cli.CommandLine) SqlClientException(org.apache.flink.table.client.SqlClientException) ParseException(org.apache.commons.cli.ParseException) DefaultParser(org.apache.commons.cli.DefaultParser)

Example 7 with SqlClientException

use of org.apache.flink.table.client.SqlClientException in project flink by apache.

the class CliOptionsParser method parseGatewayModeGateway.

public static CliOptions parseGatewayModeGateway(String[] args) {
    try {
        DefaultParser parser = new DefaultParser();
        CommandLine line = parser.parse(GATEWAY_MODE_GATEWAY_OPTIONS, args, true);
        return new CliOptions(line.hasOption(CliOptionsParser.OPTION_HELP.getOpt()), null, null, null, checkUrls(line, CliOptionsParser.OPTION_JAR), checkUrls(line, CliOptionsParser.OPTION_LIBRARY), null, null, getPythonConfiguration(line));
    } catch (ParseException e) {
        throw new SqlClientException(e.getMessage());
    }
}
Also used : CommandLine(org.apache.commons.cli.CommandLine) SqlClientException(org.apache.flink.table.client.SqlClientException) ParseException(org.apache.commons.cli.ParseException) DefaultParser(org.apache.commons.cli.DefaultParser)

Aggregations

SqlClientException (org.apache.flink.table.client.SqlClientException)7 CommandLine (org.apache.commons.cli.CommandLine)3 DefaultParser (org.apache.commons.cli.DefaultParser)3 ParseException (org.apache.commons.cli.ParseException)3 SqlExecutionException (org.apache.flink.table.client.gateway.SqlExecutionException)2 File (java.io.File)1 IOError (java.io.IOError)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 Configuration (org.apache.flink.configuration.Configuration)1 Path (org.apache.flink.core.fs.Path)1 BeginStatementSetOperation (org.apache.flink.table.operations.BeginStatementSetOperation)1 EndStatementSetOperation (org.apache.flink.table.operations.EndStatementSetOperation)1 ExplainOperation (org.apache.flink.table.operations.ExplainOperation)1 LoadModuleOperation (org.apache.flink.table.operations.LoadModuleOperation)1 ModifyOperation (org.apache.flink.table.operations.ModifyOperation)1 Operation (org.apache.flink.table.operations.Operation)1