Tal Joffe
Tal Joffe

Reputation: 5828

Presto on EMR - setting the environment variable

I'm playing with the built in Presto in AWS EMR. I want to get rid of the default pager... in the Presto docs it says:

this behavior can be overridden by setting the environment variable PRESTO_PAGER to the name of a different program such as more, or set it to an empty value to completely disable pagination.

This is probably trivial but I have no idea how to do this and couldn't find any information...

In the context of presto I think all I can do is run SQL.. Anyone with experience with this?

Upvotes: 0

Views: 1666

Answers (2)

Prasanna
Prasanna

Reputation: 21

It is working normally if executed through putty terminal. Queries are showing the complete result now.

a) Navigate to the presto client path(/opt/presto) and set the environment variable:

export PRESTO_PAGER=more;

//To check if it is set properly or not..
echo $PRESTO_PAGER; //It should display more.

b) Then open the presto client:
./presto --server localhost:8080 --catalog hive --schema database

Now less pagination won`t happen in presto client and complete multi-line results would be displayed in the presto client terminal.

Upvotes: 1

Dain Sundstrom
Dain Sundstrom

Reputation: 2858

You can set the variable permanently in bash using the export command. For example, to set the pager to the cat program, execute:

export PRESTO_PAGER=cat

To disable the pager entirely execute:

export PRESTO_PAGER=

Alternatively, you can set it on a per command basis in bash by prefixing the command line with the property. For example:

PRESTO_PAGER=cat java -jar presto-cli.executable.jar --debug --catalog tpch --schema tiny --server http://127.0.0.1:8080

Upvotes: 1

Related Questions