osdir.com
mailing list archive
Mozy Online Backup: 2GB Free. Automatic. Secure.

Subject: Re: PHP - fb303_types.php - msg#00090

List: hive-user-hadoop-apache

Date: Prev Next Index Thread: Prev Next Index
This is great! Can you provide a patch to the jira
https://issues.apache.org/jira/browse/HIVE-299? :)

Regarding changing thrift, you can create a jira at:
http://issues.apache.org/jira/browse/THRIFT
And provide a patch there as well!

raghu

On 2/23/09 2:58 PM, "Gary Richardson" <gary.richardson@xxxxxxxxx> wrote:

> Hey guys,
>
> I've pretty much got everything working now with my php setup. Thanks for all
> the help. I plan on putting a summary of how to get PHP talking to Hive at
> some point soon.
>
> I did run into one problem with reading results. The TSocket readAll() method
> would throw a timeout exception. Commenting out those exceptions made the code
> work. I dug a bit deeper and it looks the socket has timed_out == true while
> it's blocking (blocked === true). I patched my copy to get it going:
>
> @@ -213,7 +213,7 @@
> $pre = null;
> while (TRUE) {
> $buf = @fread($this->handle_, $len);
> - if ($buf === FALSE || $buf === '') {
> + if ($buf === FALSE) {
> $md = stream_get_meta_data($this->handle_);
> if ($md['timed_out']) {
> throw new TException('TSocket: timed out reading '.$len.' bytes
> from '.
> @@ -224,7 +224,7 @@
> }
> } else if (($sz = strlen($buf)) < $len) {
> $md = stream_get_meta_data($this->handle_);
> - if ($md['timed_out']) {
> + if (true === $md['timed_out'] && false === $md['blocked']) {
> throw new TException('TSocket: timed out reading '.$len.' bytes
> from '.
> $this->host_.':'.$this->port_);
> } else {
>
>
> Is this code generated by thrift? Is there somewhere I can put a bug in?
>
> Thanks.
>
> On Mon, Feb 23, 2009 at 12:00 PM, Gary Richardson <gary.richardson@xxxxxxxxx>
> wrote:
>> That got the job done.
>>
>> BTW, I also had to re-thrift the hive_service stuff -- it was missing a class
>> or two.
>>
>> Thanks!
>>
>>
>> On Mon, Feb 23, 2009 at 10:24 AM, Raghu Murthy <raghu@xxxxxxxxxxxx> wrote:
>>> Hi Gary,
>>>
>>> Looks like the php thrift infrastructure api is not completely packaged into
>>> hive. I have created a new jira to include these files.
>>> https://issues.apache.org/jira/browse/HIVE-299
>>>
>>> In the meanwhile can you try downloading and building thrift? That should
>>> generate the necessary files.
>>> http://incubator.apache.org/thrift/download/
>>>
>>> raghu
>>>
>>> On 2/23/09 10:11 AM, "Gary Richardson" <gary.richardson@xxxxxxxxx> wrote:
>>>
>>>>> Hi,
>>>>>
>>>>> I'm trying to work with the PHP thrift api and I've hit a stumbling block.
>>>>>
>>>>> My script looks like:
>>>>>
>>>>>>> #!/usr/bin/php
>>>>>>> <?php
>>>>>>>
>>>>>>> $GLOBALS['THRIFT_ROOT'] = 'thriftroot/';
>>>>>>>
>>>>>>> require_once $GLOBALS['THRIFT_ROOT'] .
>>>>>>> 'packages/hive_service/ThriftHive.php';
>>>>>
>>>>> And I'm getting the following error when I try to run it:
>>>>>
>>>>>>> PHP Warning: include_once(thriftroot//packages/fb303/fb303_types.php):
>>>>>>> failed
>>>>>>> to open stream: No such file or directory in
>>>>>>>
>>>
/root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_ty>>>
p
>>>>>
>>> e
>>>>>>> s.php on line 9
>>>>>>> PHP Warning: include_once(): Failed opening
>>>>>>> 'thriftroot//packages/fb303/fb303_types.php' for inclusion
>>>>>>> (include_path='.:/usr/share/pear:/usr/share/php') in
>>>>>>>
>>>
/root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_ty>>>
p
>>>>>
>>> e
>>>>>>> s.php on line 9
>>>>>>> PHP Warning:
>>>>>>>
>>>>>
include_once(thriftroot//packages/hive_metastore/hive_metastore_types.php)>>>>>
:
>>>>>>> failed to open stream: No such file or directory in
>>>>>>>
>>>
/root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_ty>>>
p
>>>>>
>>> e
>>>>>>> s.php on line 10
>>>>>>> PHP Warning: include_once(): Failed opening
>>>>>>> 'thriftroot//packages/hive_metastore/hive_metastore_types.php' for
>>>>> inclusion
>>>>>>> (include_path='.:/usr/share/pear:/usr/share/php') in
>>>>>>>
>>>
/root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_ty>>>
p
>>>>>
>>> e
>>>>>>> s.php on line 10
>>>>>>> PHP Warning:
>>>>>>>
>>>>> include_once(thriftroot//packages/hive_metastore/ThriftHiveMetastore.php):
>>>>>>> failed to open stream: No such file or directory in
>>>>>>>
>>>>>
/root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.ph>>>>>
p
>>>>>>> on
>>>>>>> line 10
>>>>>>> PHP Warning: include_once(): Failed opening
>>>>>>> 'thriftroot//packages/hive_metastore/ThriftHiveMetastore.php' for
>>>>> inclusion
>>>>>>> (include_path='.:/usr/share/pear:/usr/share/php') in
>>>>>>>
>>>>>
/root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.ph>>>>>
p
>>>>>>> on
>>>>>>> line 10
>>>>>>> PHP Fatal error: Interface 'ThriftHiveMetastoreIf' not found in
>>>>>>>
>>>>>
/root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.ph>>>>>
p
>>>>>>> on
>>>>>>> line 12
>>>>> I found FacebookBase.php, but my searching/googling hasn't revealed a
>>>>> fb303_types.php. My packages directory looks like:
>>>>>
>>>>> [root@ip-10-250-31-17 hive]# find thriftroot/packages/ -type f
>>>>> thriftroot/packages/hive_service/ThriftHive.php
>>>>> thriftroot/packages/hive_service/hive_service_types.php
>>>>> thriftroot/packages/fb303/FacebookBase.php
>>>>>
>>>>> Is there a package somewhere that has the fb303 thrift code in it? Do I
>>>> need
>>>>> to build it myself?
>>>>>
>>>>> Thanks!
>>>
>>
>

Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: PHP - fb303_types.php

Hey guys,I've pretty much got everything working now with my php setup. Thanks for all the help. I plan on putting a summary of how to get PHP talking to Hive at some point soon.I did run into one problem with reading results. The TSocket readAll() method would throw a timeout exception. Commenting out those exceptions made the code work. I dug a bit deeper and it looks the socket has timed_out == true while it's blocking (blocked === true). I patched my copy to get it going: @@ -213,7 +213,7 @@     $pre = null;     while (TRUE) {       $buf = @fread($this->handle_, $len);-      if ($buf === FALSE || $buf === '') {+      if ($buf === FALSE) {         $md = stream_get_meta_data($this->handle_);          if ($md['timed_out']) {           throw new TException('TSocket: timed out reading '.$len.' bytes from '.@@ -224,7 +224,7 @@         }       } else if (($sz = strlen($buf)) < $len) {          $md = stream_get_meta_data($this->handle_);-        if ($md['timed_out']) {+        if (true === $md['timed_out'] && false === $md['blocked']) {           throw new TException('TSocket: timed out reading '.$len.' bytes from '.                                 $this->host_.':'.$this->port_);         } else {Is this code generated by thrift? Is there somewhere I can put a bug in?Thanks. On Mon, Feb 23, 2009 at 12:00 PM, Gary Richardson <gary.richardson@xxxxxxxxx> wrote: That got the job done. BTW, I also had to re-thrift the hive_service stuff -- it was missing a class or two.Thanks!On Mon, Feb 23, 2009 at 10:24 AM, Raghu Murthy <raghu@xxxxxxxxxxxx> wrote: Hi Gary, Looks like the php thrift infrastructure api is not completely packaged into hive. I have created a new jira to include these files. https://issues.apache.org/jira/browse/HIVE-299 In the meanwhile can you try downloading and building thrift? That should generate the necessary files. http://incubator.apache.org/thrift/download/ raghu On 2/23/09 10:11 AM, "Gary Richardson" <gary.richardson@xxxxxxxxx> wrote: > Hi, > > I'm trying to work with the PHP thrift api and I've hit a stumbling block. > > My script looks like: > >> #!/usr/bin/php >> <?php >> >> $GLOBALS['THRIFT_ROOT'] = 'thriftroot/'; >> >> require_once $GLOBALS['THRIFT_ROOT'] . >> 'packages/hive_service/ThriftHive.php'; > > And I'm getting the following error when I try to run it: > >> PHP Warning:  include_once(thriftroot//packages/fb303/fb303_types.php): >> failed >> to open stream: No such file or directory in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 9 >> PHP Warning:  include_once(): Failed opening >> 'thriftroot//packages/fb303/fb303_types.php' for inclusion >> (include_path='.:/usr/share/pear:/usr/share/php') in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 9 >> PHP Warning: >> include_once(thriftroot//packages/hive_metastore/hive_metastore_types.php): >> failed to open stream: No such file or directory in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 10 >> PHP Warning:  include_once(): Failed opening >> 'thriftroot//packages/hive_metastore/hive_metastore_types.php' for inclusion >> (include_path='.:/usr/share/pear:/usr/share/php') in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 10 >> PHP Warning: >> include_once(thriftroot//packages/hive_metastore/ThriftHiveMetastore.php): >> failed to open stream: No such file or directory in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.php >> on >> line 10 >> PHP Warning:  include_once(): Failed opening >> 'thriftroot//packages/hive_metastore/ThriftHiveMetastore.php' for inclusion >> (include_path='.:/usr/share/pear:/usr/share/php') in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.php >> on >> line 10 >> PHP Fatal error:  Interface 'ThriftHiveMetastoreIf' not found in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.php >> on >> line 12 > I found FacebookBase.php, but my searching/googling hasn't revealed a > fb303_types.php. My packages directory looks like: > > [root@ip-10-250-31-17 hive]# find thriftroot/packages/ -type f > thriftroot/packages/hive_service/ThriftHive.php > thriftroot/packages/hive_service/hive_service_types.php > thriftroot/packages/fb303/FacebookBase.php > > Is there a package somewhere that has the fb303 thrift code in it? Do I need > to build it myself? > > Thanks!

Next Message by Date: click to view message preview

Fwd: mysql metastore problems

---------- Forwarded message ----------From: Ryan Shih <ryan.shih@xxxxxxxxx>Date: Mon, Feb 23, 2009 at 5:29 PM Subject: mysql metastore problemsTo: core-user@xxxxxxxxxxxxxxxxxHi, I'm having some problems setting up the metastore using mysql. I've browsed the message archives, but don't see anything that helps. My configuration files, look like: **<<hive-site.xml>>** <?xml version="1.0"?><?xml-stylesheet type="text/xsl" href=""><configuration>    <property>        <name>hive.metastore.local</name>         <value>true</value>        <description>this is local store</description>    </property>    <property>        <name>hive.metastore.warehouse.dir</name>         <value>/user/hive/warehouse</value>        <description>default location for Hive tables</description>    </property>    <property>        <name>hive.aux.jars.path</name>         <value>/home/ryan/hive/branch-0.2/install/custom/</value>        <description>where custom serdes live </description>    </property></configuration>**<<jpox.properties>>** javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImplorg.jpox.validateTables=falseorg.jpox.validateColumns=falseorg.jpox.validateConstraints=falseorg.jpox.storeManagerType=rdbms org.jpox.autoCreateSchema=trueorg.jpox.autoStartMechanismMode=checkedorg.jpox.transactionIsolation=read_committedjavax.jdo.option.DetachAllOnCommit=truejavax.jdo.option.NontransactionalRead=truejavax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver javax.jdo.option.ConnectionURL=jdbc:mysql://localhost/hive_metastore?createDatabaseIfNotExist=truejavax.jdo.option.ConnectionUserName=hive_userjavax.jdo.option.ConnectionPassword=hive_passorg.jpox.cache.level2=true org.jpox.cache.level2.type=SOFTAnd then with just the default hive-default.xml file. I haven't worked with JPOX tables before, but I'm under the impression that this will automatically get created from the autoCreateSchema flag. Has anyone had any luck with this? I'm getting the following error:hive> ryan@dali:~/hive/branch-0.2/install/bin$ hiveHive history file=/tmp/ryan/hive_job_log_ryan_200902231722_1088538316.txthive> create table test_table (id INT, name STRING); FAILED: Error in metadata: javax.jdo.JDODataStoreException: Error adding class org.apache.hadoop.hive.metastore.model.MDatabase to list of persistence-managed classes : Table/View 'JPOX_TABLES' does not exist. java.sql.SQLSyntaxErrorException: Table/View 'JPOX_TABLES' does not exist.    at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)    at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)     at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)    at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)    at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)     at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)    at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)    at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)     at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)    at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)    at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)     at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)    at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)    at org.jpox.store.rdbms.SQLController.getStatementForQuery(SQLController.java:324)     at org.jpox.store.rdbms.SQLController.getStatementForQuery(SQLController.java:263)    at org.jpox.store.rdbms.table.SchemaTable.hasClass(SchemaTable.java:280)    at org.jpox.store.rdbms.table.SchemaTable.addClass(SchemaTable.java:222)     at org.jpox.store.rdbms.SchemaAutoStarter.addClass(SchemaAutoStarter.java:255)    at org.jpox.store.AbstractStoreManager.registerStoreData(AbstractStoreManager.java:363)    at org.jpox.store.rdbms.RDBMSManager.access$3000(RDBMSManager.java:171)     at org.jpox.store.rdbms.RDBMSManager$ClassAdder.addClassTable(RDBMSManager.java:3001)    at org.jpox.store.rdbms.RDBMSManager$ClassAdder.addClassTables(RDBMSManager.java:2804)    at org.jpox.store.rdbms.RDBMSManager$ClassAdder.addClassTablesAndValidate(RDBMSManager.java:3098)     at org.jpox.store.rdbms.RDBMSManager$ClassAdder.run(RDBMSManager.java:2729)    at org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RDBMSManager.java:2609)    at org.jpox.store.rdbms.RDBMSManager.addClasses(RDBMSManager.java:825)     at org.jpox.store.AbstractStoreManager.addClass(AbstractStoreManager.java:624)    at org.jpox.store.mapped.MappedStoreManager.getDatastoreClass(MappedStoreManager.java:343)    at org.jpox.store.rdbms.RDBMSManager.getPropertiesForGenerator(RDBMSManager.java:1630)     at org.jpox.store.AbstractStoreManager.getStrategyValue(AbstractStoreManager.java:945)    at org.jpox.ObjectManagerImpl.newObjectId(ObjectManagerImpl.java:2473)    at org.jpox.state.JDOStateManagerImpl.setIdentity(JDOStateManagerImpl.java:792)     at org.jpox.state.JDOStateManagerImpl.initialiseForPersistentNew(JDOStateManagerImpl.java:467)    at org.jpox.state.StateManagerFactory.newStateManagerForPersistentNew(StateManagerFactory.java:151)    at org.jpox.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1230)     at org.jpox.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:1077)    at org.jpox.jdo.AbstractPersistenceManager.jdoMakePersistent(AbstractPersistenceManager.java:666)    at org.jpox.jdo.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:691)     at org.apache.hadoop.hive.metastore.ObjectStore.createDatabase(ObjectStore.java:272)    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:145)    at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:115)     at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:100)    at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:73)    at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:785)     at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:798)    at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:254)    at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:740)     at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:97)    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:238)    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:174)    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:207)     at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:306)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.apache.hadoop.util.RunJar.main(RunJar.java:155)    at org.apache.hadoop.mapred.JobShell.run(JobShell.java:54)     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)    at org.apache.hadoop.mapred.JobShell.main(JobShell.java:68)Caused by: java.sql.SQLException: Table/View 'JPOX_TABLES' does not exist.     at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)    at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)    ... 61 moreCaused by: ERROR 42X05: Table/View 'JPOX_TABLES' does not exist.     at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)    at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(Unknown Source)    at org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables(Unknown Source)     at org.apache.derby.impl.sql.compile.FromList.bindTables(Unknown Source)    at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(Unknown Source)    at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(Unknown Source)     at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown Source)    at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(Unknown Source)    at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)     at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)    at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)    ... 55 moreNestedThrowables: java.sql.SQLSyntaxErrorException: Table/View 'JPOX_TABLES' does not exist.FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTaskTime taken: 1.883 seconds

Previous Message by Thread: click to view message preview

Re: PHP - fb303_types.php

Hey guys,I've pretty much got everything working now with my php setup. Thanks for all the help. I plan on putting a summary of how to get PHP talking to Hive at some point soon.I did run into one problem with reading results. The TSocket readAll() method would throw a timeout exception. Commenting out those exceptions made the code work. I dug a bit deeper and it looks the socket has timed_out == true while it's blocking (blocked === true). I patched my copy to get it going: @@ -213,7 +213,7 @@     $pre = null;     while (TRUE) {       $buf = @fread($this->handle_, $len);-      if ($buf === FALSE || $buf === '') {+      if ($buf === FALSE) {         $md = stream_get_meta_data($this->handle_);          if ($md['timed_out']) {           throw new TException('TSocket: timed out reading '.$len.' bytes from '.@@ -224,7 +224,7 @@         }       } else if (($sz = strlen($buf)) < $len) {          $md = stream_get_meta_data($this->handle_);-        if ($md['timed_out']) {+        if (true === $md['timed_out'] && false === $md['blocked']) {           throw new TException('TSocket: timed out reading '.$len.' bytes from '.                                 $this->host_.':'.$this->port_);         } else {Is this code generated by thrift? Is there somewhere I can put a bug in?Thanks. On Mon, Feb 23, 2009 at 12:00 PM, Gary Richardson <gary.richardson@xxxxxxxxx> wrote: That got the job done. BTW, I also had to re-thrift the hive_service stuff -- it was missing a class or two.Thanks!On Mon, Feb 23, 2009 at 10:24 AM, Raghu Murthy <raghu@xxxxxxxxxxxx> wrote: Hi Gary, Looks like the php thrift infrastructure api is not completely packaged into hive. I have created a new jira to include these files. https://issues.apache.org/jira/browse/HIVE-299 In the meanwhile can you try downloading and building thrift? That should generate the necessary files. http://incubator.apache.org/thrift/download/ raghu On 2/23/09 10:11 AM, "Gary Richardson" <gary.richardson@xxxxxxxxx> wrote: > Hi, > > I'm trying to work with the PHP thrift api and I've hit a stumbling block. > > My script looks like: > >> #!/usr/bin/php >> <?php >> >> $GLOBALS['THRIFT_ROOT'] = 'thriftroot/'; >> >> require_once $GLOBALS['THRIFT_ROOT'] . >> 'packages/hive_service/ThriftHive.php'; > > And I'm getting the following error when I try to run it: > >> PHP Warning:  include_once(thriftroot//packages/fb303/fb303_types.php): >> failed >> to open stream: No such file or directory in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 9 >> PHP Warning:  include_once(): Failed opening >> 'thriftroot//packages/fb303/fb303_types.php' for inclusion >> (include_path='.:/usr/share/pear:/usr/share/php') in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 9 >> PHP Warning: >> include_once(thriftroot//packages/hive_metastore/hive_metastore_types.php): >> failed to open stream: No such file or directory in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 10 >> PHP Warning:  include_once(): Failed opening >> 'thriftroot//packages/hive_metastore/hive_metastore_types.php' for inclusion >> (include_path='.:/usr/share/pear:/usr/share/php') in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 10 >> PHP Warning: >> include_once(thriftroot//packages/hive_metastore/ThriftHiveMetastore.php): >> failed to open stream: No such file or directory in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.php >> on >> line 10 >> PHP Warning:  include_once(): Failed opening >> 'thriftroot//packages/hive_metastore/ThriftHiveMetastore.php' for inclusion >> (include_path='.:/usr/share/pear:/usr/share/php') in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.php >> on >> line 10 >> PHP Fatal error:  Interface 'ThriftHiveMetastoreIf' not found in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.php >> on >> line 12 > I found FacebookBase.php, but my searching/googling hasn't revealed a > fb303_types.php. My packages directory looks like: > > [root@ip-10-250-31-17 hive]# find thriftroot/packages/ -type f > thriftroot/packages/hive_service/ThriftHive.php > thriftroot/packages/hive_service/hive_service_types.php > thriftroot/packages/fb303/FacebookBase.php > > Is there a package somewhere that has the fb303 thrift code in it? Do I need > to build it myself? > > Thanks!

Next Message by Thread: click to view message preview

Re: PHP - fb303_types.php

Hey guys,Thanks for all the help. I've posted my howto on my blog: http://www.cultofgary.com/2009/02/24/making-php-talk-to-hive-through-thrift/ Thanks!On Mon, Feb 23, 2009 at 2:58 PM, Gary Richardson <gary.richardson@xxxxxxxxx> wrote: Hey guys,I've pretty much got everything working now with my php setup. Thanks for all the help. I plan on putting a summary of how to get PHP talking to Hive at some point soon.I did run into one problem with reading results. The TSocket readAll() method would throw a timeout exception. Commenting out those exceptions made the code work. I dug a bit deeper and it looks the socket has timed_out == true while it's blocking (blocked === true). I patched my copy to get it going: @@ -213,7 +213,7 @@     $pre = null;     while (TRUE) {       $buf = @fread($this->handle_, $len);-      if ($buf === FALSE || $buf === '') {+      if ($buf === FALSE) {         $md = stream_get_meta_data($this->handle_);          if ($md['timed_out']) {           throw new TException('TSocket: timed out reading '.$len.' bytes from '.@@ -224,7 +224,7 @@         }       } else if (($sz = strlen($buf)) < $len) {          $md = stream_get_meta_data($this->handle_);-        if ($md['timed_out']) {+        if (true === $md['timed_out'] && false === $md['blocked']) {           throw new TException('TSocket: timed out reading '.$len.' bytes from '.                                 $this->host_.':'.$this->port_);         } else {Is this code generated by thrift? Is there somewhere I can put a bug in?Thanks. On Mon, Feb 23, 2009 at 12:00 PM, Gary Richardson <gary.richardson@xxxxxxxxx> wrote: That got the job done. BTW, I also had to re-thrift the hive_service stuff -- it was missing a class or two.Thanks!On Mon, Feb 23, 2009 at 10:24 AM, Raghu Murthy <raghu@xxxxxxxxxxxx> wrote: Hi Gary, Looks like the php thrift infrastructure api is not completely packaged into hive. I have created a new jira to include these files. https://issues.apache.org/jira/browse/HIVE-299 In the meanwhile can you try downloading and building thrift? That should generate the necessary files. http://incubator.apache.org/thrift/download/ raghu On 2/23/09 10:11 AM, "Gary Richardson" <gary.richardson@xxxxxxxxx> wrote: > Hi, > > I'm trying to work with the PHP thrift api and I've hit a stumbling block. > > My script looks like: > >> #!/usr/bin/php >> <?php >> >> $GLOBALS['THRIFT_ROOT'] = 'thriftroot/'; >> >> require_once $GLOBALS['THRIFT_ROOT'] . >> 'packages/hive_service/ThriftHive.php'; > > And I'm getting the following error when I try to run it: > >> PHP Warning:  include_once(thriftroot//packages/fb303/fb303_types.php): >> failed >> to open stream: No such file or directory in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 9 >> PHP Warning:  include_once(): Failed opening >> 'thriftroot//packages/fb303/fb303_types.php' for inclusion >> (include_path='.:/usr/share/pear:/usr/share/php') in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 9 >> PHP Warning: >> include_once(thriftroot//packages/hive_metastore/hive_metastore_types.php): >> failed to open stream: No such file or directory in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 10 >> PHP Warning:  include_once(): Failed opening >> 'thriftroot//packages/hive_metastore/hive_metastore_types.php' for inclusion >> (include_path='.:/usr/share/pear:/usr/share/php') in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/hive_service_typ>> e >> s.php on line 10 >> PHP Warning: >> include_once(thriftroot//packages/hive_metastore/ThriftHiveMetastore.php): >> failed to open stream: No such file or directory in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.php >> on >> line 10 >> PHP Warning:  include_once(): Failed opening >> 'thriftroot//packages/hive_metastore/ThriftHiveMetastore.php' for inclusion >> (include_path='.:/usr/share/pear:/usr/share/php') in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.php >> on >> line 10 >> PHP Fatal error:  Interface 'ThriftHiveMetastoreIf' not found in >> /root/leap/dev/servers/hive/thriftroot/packages/hive_service/ThriftHive.php >> on >> line 12 > I found FacebookBase.php, but my searching/googling hasn't revealed a > fb303_types.php. My packages directory looks like: > > [root@ip-10-250-31-17 hive]# find thriftroot/packages/ -type f > thriftroot/packages/hive_service/ThriftHive.php > thriftroot/packages/hive_service/hive_service_types.php > thriftroot/packages/fb303/FacebookBase.php > > Is there a package somewhere that has the fb303 thrift code in it? Do I need > to build it myself? > > Thanks!
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by