- Notifications
You must be signed in to change notification settings - Fork0
The official home of the Presto distributed SQL query engine for big data
License
Rijin-N/presto
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Presto is a distributed SQL query engine for big data.
See thePresto installation documentation for deployment instructions.
See thePresto documentation for general documentation.
SeePrestoDB: Mission and Architecture.
- Mac OS X or Linux
- Java 8 Update 151 or higher (8u151+), 64-bit. Both Oracle JDK and OpenJDK are supported.
- Maven 3.6.3+ (for building)
- Python 2.4+ (for running with the launcher script)
Presto is a standard Maven project. Simply run the following command from the project root directory:
./mvnw clean install
On the first build, Maven will download all the dependencies from the internet and cache them in the local repository (~/.m2/repository
), which can take a considerable amount of time. Subsequent builds will be faster.
Presto has a comprehensive set of unit tests that can take several minutes to run. You can disable the tests when building:
./mvnw clean install -DskipTests
After building Presto for the first time, you can load the project into your IDE and run the server. We recommend usingIntelliJ IDEA. Because Presto is a standard Maven project, you can import it into your IDE using the rootpom.xml
file. In IntelliJ, choose Open Project from the Quick Start box or choose Open from the File menu and select the rootpom.xml
file.
After opening the project in IntelliJ, double check that the Java SDK is properly configured for the project:
- Open the File menu and select Project Structure
- In the SDKs section, ensure that a 1.8 JDK is selected (create one if none exist)
- In the Project section, ensure the Project language level is set to 8.0 as Presto makes use of several Java 8 language features
Presto comes with sample configuration that should work out-of-the-box for development. Use the following options to create a run configuration:
- Main Class:
com.facebook.presto.server.PrestoServer
- VM Options:
-ea -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties
- Working directory:
$MODULE_WORKING_DIR$
or$MODULE_DIR$
(Depends your version of IntelliJ) - Use classpath of module:
presto-main
The working directory should be thepresto-main
subdirectory. In IntelliJ, using$MODULE_DIR$
accomplishes this automatically.
Additionally, the Hive plugin must be configured with location of your Hive metastore Thrift service. Add the following to the list of VM options, replacinglocalhost:9083
with the correct host and port (or use the below value if you do not have a Hive metastore):
-Dhive.metastore.uri=thrift://localhost:9083
If your Hive metastore or HDFS cluster is not directly accessible to your local machine, you can use SSH port forwarding to access it. Setup a dynamic SOCKS proxy with SSH listening on local port 1080:
ssh -v -N -D 1080 server
Then add the following to the list of VM options:
-Dhive.metastore.thrift.client.socks-proxy=localhost:1080
Start the CLI to connect to the server and run SQL queries:
presto-cli/target/presto-cli-*-executable.jar
Run a query to see the nodes in the cluster:
SELECT * FROM system.runtime.nodes;
In the sample configuration, the Hive connector is mounted in thehive
catalog, so you can run the following queries to show the tables in the Hive databasedefault
:
SHOW TABLES FROM hive.default;
To build the Presto docs, see thedocs README.
The Presto Console is composed of several React components and is written in JSX and ES6. Thissource code is stored in thepresto-ui/
module. The compilation process generatesbrowser-compatible javascript which is added as JAR resources during the maven build. When theresource JAR is included on the classpath of Presto coordinator, it will be able to serve theresources.
None of the Java code relies on the Presto UI project being compiled, so it is possible to excludethis UI when building Presto. Add the property-DskipUI
to the maven command to disable buildingtheui
maven module.
./mvnw clean install -DskipUI
You must haveNode.js andYarn installed to build the UI. When using Maven to buildthe project, Node and yarn are installed in thepresto-ui/target
folder. Add the node and yarnexecutables to thePATH
environment variable.
To update Presto Console after making changes, run:
yarn --cwd presto-ui/src install
To simplify iteration, you can also run inwatch
mode, which automatically re-compiles whenchanges to source files are detected:
yarn --cwd presto-ui/src run watch
To iterate quickly, simply re-build the project in IntelliJ after packaging is complete. Projectresources will be hot-reloaded and changes are reflected on browser refresh.
Presto native is a C++ rewrite of Presto worker.Presto native usesVelox as its primary engine to run presto workloads.
Velox is a C++ database library which provides reusable, extensible, and high-performance data processing components.
Check outbuilding instructions to get started.
Please refer to thecontribution guidelines to get started.
Please join our Slack channel and ask in#dev
.
By contributing to Presto, you agree that your contributions will be licensed under theApache License Version 2.0 (APLv2).