分布式大数据SQL查询引擎,适用于交互式分析查询
Java HTML ANTLR Shell Makefile PLSQL
Pull request Compare This branch is 10 commits ahead, 4275 commits behind prestodb:master.
Permalink
Failed to load latest commit information.
presto-base-jdbc 1.Add sqlserver plugin Jun 25, 2015
presto-benchmark-driver [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-benchmark [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-cassandra 为Hive连接器添加insert功能,与hive insert语法相同 Jun 23, 2015
presto-cli [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-client [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-docs [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-example-http [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-hive-cdh4 [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-hive-cdh5 [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-hive-hadoop1 [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-hive-hadoop2 [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-hive 添加create table动态分区功能 Jun 23, 2015
presto-jdbc [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-kafka Fix #2704 Jun 24, 2015
presto-main 定制fix和source stage节点 Jun 25, 2015
presto-ml [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-mysql 1.Add sqlserver plugin Jun 25, 2015
presto-orc [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-parser 添加create table动态分区功能 Jun 23, 2015
presto-postgresql 1.Add sqlserver plugin Jun 25, 2015
presto-raptor 为Hive连接器添加insert功能,与hive insert语法相同 Jun 23, 2015
presto-server 1.Add sqlserver plugin Jun 25, 2015
presto-spi 1.Add sqlserver plugin Jun 25, 2015
presto-sqlserver 1.Add sqlserver plugin Jun 25, 2015
presto-tests 添加varchar到bigint和double的隐式转换 Jun 23, 2015
presto-tpch [maven-release-plugin] prepare release 0.107 Jun 5, 2015
presto-verifier [maven-release-plugin] prepare release 0.107 Jun 5, 2015
src Add all datetime data types Apr 17, 2014
.gitignore Allow Eclipse to build presto again. Sep 25, 2014
.travis.yml Reduce Travis memory usage for build Mar 16, 2015
CONTRIBUTING.md New CLA form Apr 22, 2014
LICENSE Add LICENSE file Oct 1, 2013
README.md Update documented Maven requirement Apr 30, 2015
pom.xml 1.Add sqlserver plugin Jun 25, 2015

README.md

Presto

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, 64-bit
  • Maven 3.2.3+ (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:

mvn 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:

mvn 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 properly 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 -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;