PHPackages                             webberwu/php-presto-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. webberwu/php-presto-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

webberwu/php-presto-client
==========================

PHP PrestoDB.io Client is forked from nanernunes

0.1.1(7y ago)0208Apache-2.0PHPPHP &gt;=5.3.0

Since Mar 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/webberwu/PhpPrestoClient)[ Packagist](https://packagist.org/packages/webberwu/php-presto-client)[ RSS](/packages/webberwu-php-presto-client/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (3)Used By (0)

PhpPrestoClient
===============

[](#phpprestoclient)

Simple Php Class to connect to a PrestoDB Server that runs distributed queries against a Hadoop HDFS cluster. Presto uses a subset of SQL as its query language. Presto is an alternative for Hadoop-Hive or Impala.

Usage
-----

[](#usage)

See Demo.php for a short demo on how to use it

Requirement
-----------

[](#requirement)

Php-Curl

Compatibility
-------------

[](#compatibility)

Tested successfully with all version of Presto up to 0.58

Presto client protocol
----------------------

[](#presto-client-protocol)

The following description was made by Ivo Herweijer for its Python interface

The communication protocol used between Presto clients and servers is not documented yet. It seems to be as follows:

Client sends http POST request to the Presto server, page: "/v1/statement". Header information should include: X-Presto-Catalog, X-Presto-Source, X-Presto-Schema, User-Agent, X-Presto-User. The body of the request should contain the sql statement. The server responds by returning JSON data (http status-code 200). This reply may contain up to 3 uri's. One giving the link to get more information about the query execution ('infoUri'), another giving the link to fetch the next packet of data ('nextUri') and one with the uri to cancel the query ('partialCancelUri').

The client should send GET requests to the server (Header: X-Presto-Source, User-Agent, X-Presto-User. Body: empty) following the 'nextUri' link from the previous response until the servers response does not contain an 'nextUri' link anymore. When there is no 'nextUri' the query is finished. If the last response from the server included an error section ('error') the query failed, otherwise the query succeeded. If the http status of the server response is anything other than 200 with Content-Type application/json, the query should also be considered failed. A 503 http response means that the server is (too) busy. Retry the request after waiting at least 50ms. The server response may contain a 'state' variable. This is for informational purposes only (may be subject to change in future implementations). Each response by the server to a 'nextUri' may contain information about the columns returned by the query and all- or part of the querydata. If the response contains a data section the columns section will always be available.

The server reponse may contain a variable with the uri to cancel the query ('partialCancelUri'). The client may issue a DELETE request to the server using this link. Response http status-code is 204.

The Presto server will retain information about finished queries for 15 minutes. When a client does not respond to the server (by following the 'nextUri' links) the server will cancel these 'dead' queries after 5 minutes. These timeouts are hardcoded in the Presto server source code.

Thanks
------

[](#thanks)

Thanks to Ivo Herweijer from easywarehousing.com that is doing a Python interface and from which I copied the protocol description and took some inspiration for the Php interface.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~212 days

Total

2

Last Release

2781d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/28b59997a4853367c92bb0f48fc506988590bb0f6eeba8ab8db44b66703d649a?d=identicon)[webberwu](/maintainers/webberwu)

---

Top Contributors

[![webberwu](https://avatars.githubusercontent.com/u/617034?v=4)](https://github.com/webberwu "webberwu (19 commits)")[![nanernunes](https://avatars.githubusercontent.com/u/4689514?v=4)](https://github.com/nanernunes "nanernunes (1 commits)")

### Embed Badge

![Health badge](/badges/webberwu-php-presto-client/health.svg)

```
[![Health](https://phpackages.com/badges/webberwu-php-presto-client/health.svg)](https://phpackages.com/packages/webberwu-php-presto-client)
```

###  Alternatives

[s1lentium/iptools

PHP Library for manipulating network addresses (IPv4 and IPv6)

2446.2M24](/packages/s1lentium-iptools)[rector/swiss-knife

Swiss knife in pocket of every upgrade architect

2001.9M55](/packages/rector-swiss-knife)[rogervila/array-diff-multidimensional

Compare the difference between two multidimensional arrays

1134.4M8](/packages/rogervila-array-diff-multidimensional)[typo3/cms-lowlevel

TYPO3 CMS Lowlevel - Technical analysis of the system. This includes raw database search, checking relations, counting pages and records etc.

177.6M206](/packages/typo3-cms-lowlevel)[jfcherng/php-mb-string

A high performance multibytes sting implementation for frequently reading/writing operations.

145.1M1](/packages/jfcherng-php-mb-string)[symfony/object-mapper

Provides a way to map an object to another object

34885.7k18](/packages/symfony-object-mapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
