Download the PHP package automattic/php-thrift-sql without Composer

On this page you can find all versions of the php package automattic/php-thrift-sql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

Please rate this library. Is it a good library?

All versions of php-thrift-sql with dependencies

Informations about the package php-thrift-sql

PHP ThriftSQL

The ThriftSQL.phar archive aims to provide access to SQL-on-Hadoop frameworks for PHP. It bundles Thrift and various service packages together and exposes a common interface for running queries over the various frameworks.

Currently the following engines are supported:

Version Compatibility

This library is currently compiled against the Thrift definitions of the following database versions:

Using the compiler and base PHP classes of:

Usage Example

The recommended way to use this library is to get results from Hive/Impala via the memory efficient iterator which will keep the connection open and scroll through the results a couple rows at a time. This allows the processing of large result datasets one record at a time minimizing PHP's memory consumption.

The downside to using the memory efficient iterator is that we can only iterate over the result set once. If a second foreach is called on the same iterator object an exception is thrown by default to prevent the same query from executing on Hive/Impala again as results are not cached within the PHP client. This can be turned off however be aware iterating over the same iterator object may produce different results as the query is rerun.

Consider the following example:

Which will output something like:

If the result set is small and it would be easier to load all of it into PHP memory the queryAndFetchAll() method can be used which will return a plain numeric multidimensional array of the full result set.

Developing & Contributing

In order to rebuild this library you will need Composer to install dev dependencies and Apache Thrift to compile client libraries from the Thrift interface definition files.

Once dev tools are installed, make sure you get all git submodules:

And then the phar can be rebuilt using make:

NOTE: If you get a BadMethodCallException, it may come from any of the reasons mentioned in the PHP doc, or even a low soft limit on open file descriptors since Phar::compressfiles keeps all files opened until it writes the compressed phar.


Version
Requires php Version >=5.5.0

The package automattic/php-thrift-sql contains the following files

Loading the files please wait ....