caesar
caesar

Reputation: 47

Can I execute presto CLI without specifying --server or --catalog

I would like to know where, if it is possible, I can configure default catalog and server values to use when executing the presto CLI.

Presto CLI info:

ls -lthr /opt/presto-server-0.169/presto

/opt/presto-server-0.169/presto -> presto-cli-0.169-executable.jar

And instead of executing:

/opt/presto-server-0.169/presto --server localhost:6666 --schema abc --catalog catalog-1

I would like to execute:

/opt/presto-server-0.169/presto

with it picking up localhost:6666 as my server and catalog-1 as my catalog. I would like to specify the schema once I make the connection.

Any help will be appreciated!

Thanks.

Upvotes: 0

Views: 887

Answers (1)

Sayat Satybald
Sayat Satybald

Reputation: 6580

There is no such option to set host in console lazily. The server needs to be defined upfront by default localhost:8080 is used.

If you cannot pass proper arguments to the presto-cli and cannot use the default server host, you can change default values in presto-cli source code and compile your version.

  • You need to checkout project at github.
  • Change default values in ClientOptions.
  • Package jar for presto cli: cd presto-cli && mvn package
  • You can find a jar in target/presto-cli-0.201-SNAPSHOT.jar

For schema/catalog, you can define it in the console itself with USE command. The syntax as follows: USE [<catalog>.]<schema>.

Please note that with each version of presto you need also compile and maintain your own version of presto-cli, which might become a burden quite soon.

Upvotes: 1

Related Questions