我正在尝试从<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div>
<span>Bye!</span>
</div>
类jQuery Documentation中选择和UPSERT
值。我可以PHP
使用select
查询端口php curl
上安装的服务器,就像我在示例中分享一样。
同样,我试图使用PHP Curl在Phoenix中插入数据8765
。它给了我响应,但数据没有插入。
(UPSERT)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://localhost:8765/");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = array();
// For Select.
//$headers[] = 'request: {"request":"prepareAndExecute","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","sql":"select * from BLOG.POST"}';
// For Upsert.
$headers[] = 'request: {"request":"prepareAndExecute","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","sql":"UPSERT INTO BLOG.POST (POST_ID,TITLE,CONTENT) values (\'aa11111\',\'Test Title\',\'this is test post content\')"}';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$server_output = curl_exec ($ch);
curl_close ($ch);
所以有人可以建议我的方法有什么不对吗?或者通过php类连接Apache phoenix的任何其他方法。
答案 0 :(得分:0)
您好,您只需要关注hbase配置文件中的内容。
phoenix.connection.autoCommit = true to hbase-site.xml