No description
  • Java 98.4%
  • JavaScript 0.7%
  • Csound 0.4%
  • HTML 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nezih Yigitbasi d3c9272f3d Move tagged memory allocations on memory pool update
When a query is moved from one pool to another we need to also move
the tagged memory allocations properly to the new memory pool.
2018-07-26 15:04:57 -07:00
.mvn Remove maven-buildtime-extension 2017-10-04 22:43:58 -07:00
presto-accumulo Implement Optional-based connector metadata API in Accumulo 2018-07-18 11:01:02 +02:00
presto-array [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-atop [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-base-jdbc Use explicit Optional in ConnectorMetadata 2018-07-18 11:01:02 +02:00
presto-benchmark [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-benchmark-driver [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-benchto-benchmarks Define Kafka benchmarks 2018-07-23 11:10:02 +02:00
presto-blackhole Use explicit Optional in ConnectorMetadata 2018-07-18 11:01:02 +02:00
presto-cassandra Replace lenient matching in test with explicit declaration in subclasses 2018-07-18 08:14:15 +02:00
presto-cli [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-client [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-docs added column properties 2018-07-24 10:55:07 +02:00
presto-example-http Use explicit Optional in ConnectorMetadata 2018-07-18 11:01:02 +02:00
presto-geospatial [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-geospatial-toolkit [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-hive Add support for tagging memory allocations 2018-07-25 16:05:45 -07:00
presto-hive-hadoop2 [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-jdbc Replace distributed_join with join_distribution_type session property 2018-07-20 08:09:58 -07:00
presto-jmx [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-kafka Better exception handling in KafkaRecordSet 2018-07-23 11:10:02 +02:00
presto-local-file [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-main Move tagged memory allocations on memory pool update 2018-07-26 15:04:57 -07:00
presto-matching [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-memory Use explicit Optional in ConnectorMetadata 2018-07-18 11:01:02 +02:00
presto-memory-context Add support for tagging memory allocations 2018-07-25 16:05:45 -07:00
presto-ml [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-mongodb [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-mysql Remove stray comment 2018-07-18 08:14:15 +02:00
presto-orc Add support for tagging memory allocations 2018-07-25 16:05:45 -07:00
presto-parser added column properties 2018-07-24 10:55:07 +02:00
presto-password-authenticators [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-plugin-toolkit Fail FileBasedAccessControl on uknown rules 2018-07-18 10:59:30 +02:00
presto-postgresql [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-product-tests added column properties 2018-07-24 10:55:07 +02:00
presto-proxy [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-raptor Remove unused TableIdentity and ColumnIdentity 2018-07-18 11:03:33 +02:00
presto-rcfile [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-record-decoder Add validation and tests for DefaultJsonFieldDecoder 2018-07-23 11:10:02 +02:00
presto-redis Move FieldDecoder to presto-redis as RedisFieldDecoder 2018-07-23 11:10:02 +02:00
presto-redshift [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-resource-group-managers [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-server [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-server-rpm [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-spi Add support for tagging memory allocations 2018-07-25 16:05:45 -07:00
presto-sqlserver [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-teradata-functions [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-testing-server-launcher [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-tests Implement approx_distinct for CHAR type 2018-07-20 12:50:04 -04:00
presto-thrift-connector [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-thrift-connector-api [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-thrift-testing-server [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
presto-tpcds Implement Optional-based connector metadata API in Tpcds 2018-07-18 11:01:02 +02:00
presto-tpch Implement Optional-based connector metadata API in Tpch 2018-07-18 11:01:02 +02:00
presto-verifier [maven-release-plugin] prepare for next development iteration 2018-07-17 17:31:54 -07:00
src Prefer String.toLowerCase(ENGLISH) over String.toLowerCase() 2018-07-09 13:18:21 +02:00
.gitignore Add .editorconfig to .gitignore 2017-06-09 21:32:55 +02:00
.travis.yml Add inital Kafka smoke product tests 2018-07-23 11:10:02 +02:00
CONTRIBUTING.md New CLA form 2014-04-22 09:10:04 -07:00
LICENSE Add LICENSE file 2013-10-01 10:42:55 -07:00
mvnw Update Maven wrapper to 3.5.0 2017-04-12 08:18:21 -07:00
pom.xml Upgrade to Airlift 0.172 2018-07-24 16:27:22 -07:00
README.md Fix README for JDK requirements 2018-04-05 15:14:20 +02:00

Presto Build Status

Presto is a distributed SQL query engine for big data.

See the User Manual for deployment instructions and end user documentation.

Requirements

  • Mac OS X or Linux
  • Java 8 Update 92 or higher (8u92+), 64-bit. Both Oracle JDK and OpenJDK are supported.
  • Maven 3.3.9+ (for building)
  • Python 2.4+ (for running with the launcher script)

Building Presto

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

Running Presto in your IDE

Overview

After building Presto for the first time, you can load the project into your IDE and run the server. We recommend using IntelliJ IDEA. Because Presto is a standard Maven project, you can import it into your IDE using the root pom.xml file. In IntelliJ, choose Open Project from the Quick Start box or choose Open from the File menu and select the root pom.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_DIR$
  • Use classpath of module: presto-main

The working directory should be the presto-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, replacing localhost: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

Using SOCKS for Hive or HDFS

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

Running the CLI

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 the hive catalog, so you can run the following queries to show the tables in the Hive database default:

SHOW TABLES FROM hive.default;

Developers

We recommend you use IntelliJ as your IDE. The code style template for the project can be found in the codestyle repository along with our general programming and Java guidelines. In addition to those you should also adhere to the following:

  • Alphabetize sections in the documentation source files (both in table of contents files and other regular documentation files). In general, alphabetize methods/variables/sections if such ordering already exists in the surrounding code.
  • When appropriate, use the Java 8 stream API. However, note that the stream implementation does not perform well so avoid using it in inner loops or otherwise performance sensitive sections.
  • Categorize errors when throwing exceptions. For example, PrestoException takes an error code as an argument, PrestoException(HIVE_TOO_MANY_OPEN_PARTITIONS). This categorization lets you generate reports so you can monitor the frequency of various failures.
  • Ensure that all files have the appropriate license header; you can generate the license by running mvn license:format.
  • Consider using String formatting (printf style formatting using the Java Formatter class): format("Session property %s is invalid: %s", name, value) (note that format() should always be statically imported). Sometimes, if you only need to append something, consider using the + operator.
  • Avoid using the ternary operator except for trivial expressions.
  • Use an assertion from Airlift's Assertions class if there is one that covers your case rather than writing the assertion by hand. Over time we may move over to more fluent assertions like AssertJ.
  • When writing a Git commit message, follow these guidelines.