Giter VIP home page Giter VIP logo

albertocsm / presto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prestodb/presto

46.0 14.0 21.0 67.45 MB

Distributed SQL query engine for running interactive analytic queries against big data sources.

Home Page: https://prestodb.io

License: Apache License 2.0

Shell 0.11% Java 98.67% Makefile 0.03% Python 0.02% HTML 0.36% SQLPL 0.04% PLSQL 0.03% JavaScript 0.57% ANTLR 0.12% CSS 0.04%

presto's Introduction

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 60 or higher (8u60+), 64-bit
  • 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:

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

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.

presto's People

Contributors

albertocsm avatar alexoss68 avatar amleshjk avatar arhimondr avatar arturgajowy avatar cawallin avatar cberner avatar dain avatar electrum avatar erichwang avatar fiedukow avatar geraint0923 avatar haozhun avatar harunurhan avatar hgschmie avatar joyyao8 avatar kokosing avatar losipiuk avatar maciejgrzybek avatar martint avatar miniway avatar nezihyigitbasi avatar nileema avatar pnowojski avatar rishidwivedi avatar rschlussel-zz avatar sopel39 avatar yaoxin226 avatar yuananf avatar zhenxiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

presto's Issues

implicit all-table-indices performance

when no index is specified for a type/table, all indices, its mappings and columns are taken in consideration. this is not performant at all;

if a specific index is to be queried to determine the table columns, u need to specify the index name on the table mapping
e.g.

{
            "name": "fancyPantsTable",
            "sources": [
                {
                    "hostaddress": "127.0.0.1",
                    "port": 9300,
                    "clusterName": "some-cluster-name",
                    "type": "document-type-name",
                     "index": "one-index-for-this-table"
                }
            ]
}

if the table is to be mapped to more then one index but it still is a finite and pre determined number of indices, one can specify them with multiple entries in the previous array

fix logging

currently done with "System.out.println()"

elasticsearch connect error

I build project and install es plugin,however I got this error in server.log:

2017-12-12T14:53:10.002+0800    ERROR   main    com.facebook.presto.server.PrestoServer Method com/facebook/presto/elasticsearch/ElasticsearchPlugin.getServices(Ljava/lang/Class;)Ljava/util/List; is abstract
java.lang.AbstractMethodError: Method com/facebook/presto/elasticsearch/ElasticsearchPlugin.getServices(Ljava/lang/Class;)Ljava/util/List; is abstract
        at com.facebook.presto.elasticsearch.ElasticsearchPlugin.getServices(ElasticsearchPlugin.java)
        at com.facebook.presto.server.PluginManager.installPlugin(PluginManager.java:194)
        at com.facebook.presto.server.PluginManager.loadPlugin(PluginManager.java:184)
        at com.facebook.presto.server.PluginManager.loadPlugin(PluginManager.java:167)
        at com.facebook.presto.server.PluginManager.loadPlugins(PluginManager.java:148)
        at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:113)
        at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:63)

Elasticsearch 5.x support

Getting incompatible client error when connecting to ES 5.1. Any plan to fix this? Or any pointers on how to fix would be great, I'd like to help getting this work. Thanks

Also it'd be nice to support the ES REST API to be able to access ES servers that only allow http client. One advantage of using REST is that the connector is less likely to break on new ES versions. https://github.com/searchbox-io/Jest/tree/master/jest might be useful for this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.