Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法通过PHP在Apache Phoenix中插入记录_Php_Hbase_Phoenix - Fatal编程技术网

无法通过PHP在Apache Phoenix中插入记录

无法通过PHP在Apache Phoenix中插入记录,php,hbase,phoenix,Php,Hbase,Phoenix,我正在尝试从PHP类中选择和UPSERT值。我能够使用php curl选择,查询安装在端口8765上的服务器,就像我在示例中的共享一样。 类似地,我尝试使用PHP Curl在Phoenix中插入数据(UPSERT)。它给了我回应,但没有插入数据 PHP 有人能告诉我我的方法有什么不对吗?或者通过php类连接ApachePhoenix的任何其他方法 您好,您只需要在您的hbase配置文件中添加以下内容 phoenix.connection.autoCommit=true to hbase-site

我正在尝试从
PHP
类中选择和
UPSERT
值。我能够使用
php curl
选择
,查询安装在端口
8765
上的服务器,就像我在示例中的共享一样。 类似地,我尝试使用PHP Curl在Phoenix中插入数据
(UPSERT)
。它给了我回应,但没有插入数据

PHP
有人能告诉我我的方法有什么不对吗?或者通过php类连接ApachePhoenix的任何其他方法

您好,您只需要在您的hbase配置文件中添加以下内容


phoenix.connection.autoCommit=true to hbase-site.xml

您好,您只需要在您的hbase配置文件中执行以下操作


phoenix.connection.autoCommit=true to hbase-site.xml

什么是
UPSERT
?您的意思是
INSERT
那么您是否已将传递给服务器的查询中的
UPSERT
更改为
INSERT
?否,因为我指的是我需要使用
UPSERT
插入数据的位置。请建议我,我是否需要更改此设置?什么是
UPSERT
?您的意思是
INSERT
那么您是否已将传递给服务器的查询中的
UPSERT
更改为
INSERT
?否,因为我指的是我需要使用
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);
 {"response":"Service$ExecuteResponse","results":[{"response":"resultSet","connectionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","statementId":1164383384,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":1}]}