workbunny / php-orc
PHP library for reading and writing Apache ORC file format. It uses the swoole/phpy extension to call the Python module PyORC for implementation.
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 0
Forks: 2
Open Issues: 0
pkg:composer/workbunny/php-orc
Requires
- php: >=8.1
- symfony/console: ^6.0 | ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^10.0
- swoole/phpy: ^1.0
- symfony/var-dumper: ^7.2
Suggests
- swoole/phpy: For use PyOrc to read and write Apache ORC file format.
README
workbunny/php-orc
🐇 PHP library for reading and writing Apache ORC file format. It uses the swoole/phpy extension to call the Python module PyORC for implementation.
简介
- 通过
swoole/PHPy内联调用python/pyorc实现对Apache ORC格式文件的读写
安装
-
安装composer包
composer require workbunny/php-orc
-
安装Python、pip、Python-dev
自行安装 或 通过
.vendor/bin/php-orc install:python安装,.vendor/bin/php-orc install:python --help查看帮助 -
安装
PHPy拓展自行安装 或 通过
.vendor/bin/php-orc install:phpy安装,.vendor/bin/php-orc install:phpy --help查看帮助 -
安装
pyorc及依赖模块自行安装 或 通过
.vendor/bin/php-orc install:pyorc安装,.vendor/bin/php-orc install:pyorc --help查看帮助
使用
直接使用
通过swoole/PHPy创建Reader和Writer实例,使用PHP代理类代理调用
- 实例化
Reader类进行读取操作,详细参考examples/reader.php - 实例化
Writer类进行写入操作,详细参考examples/writer.php
继承使用
通过swoole/PHPy创建Reader和Writer继承类,使用PHP类继承Python类,可直接调用/重写/拓展父类方法、参数
- 继承
ReaderClass类进行读取操作的拓展开发或使用,详细参考examples/readerClass.php - 继承
WriterClass类进行写入操作的拓展开发或使用,详细参考examples/writerClass.php
说明
- 关于
Apache ORC格式可以参考Apache ORC - 关于
Python/PyORC可以参考Python/PyORC- 建议使用
--venv虚拟环境安装,在当前项目根目录中会创建.venv目录存放源码
- 建议使用
- 关于使用上的代码问题,可以参考
swoole/PHPy的文档PHPy - 使用本组件基于
Class进行深度开发需要对Python及PyORC有一定了解
其他格式
Apache ParquetApache Iceberg- 暂无,后续
workbunny会推出
- 暂无,后续