dongquan8753 2016-08-16 07:31
浏览 245

如何在php中使用spark提交执行python脚本?

I am working on an PHP application using MongoDB as a database platform. Collection in MongoDB has massive volume of data .Hence I have opted for Apache Spark to generate analytics.

I need to execute spark-submit command from PHP application.But its execution doesn't return any output to PHP application.

Following is code snippet

$result=shell_exec('./bin/spark-submit examples/src/main/python/pi.py'); 
print_r($result);

Please suggest me an appropriate solution

  • 写回答

1条回答 默认 最新

  • dpprx26000 2016-08-16 17:39
    关注

    Besides ensuring the Python script is outputting data, if you bang your head against the wall for too long you could consider using the Python script to put data into a database or file to be pulled from by PHP.

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!