thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khoi Nguyen Minh" <kho...@dkt.com.vn>
Subject Problem with null value in Thrift map
Date Thu, 24 Jun 2010 11:49:37 GMT
Hi all,

 

I have a problem with null value in the Thrift map<string, string>.

 

For example I have a thrift service file like this:

 

typedef map<string, string> StringMap

service TestService {

                i32 updateData(1:string table, 2:StringMap data, 3:StringMap
condition);

}

 

I use PHP for Thrift Client and Java for Thrift Server.

 

$table = 'user';

$data = array('district_id', 1);

$condition = array('id', '1000');

$result = $client->updateData($table, $data, $condition);

 

Everything OK with this setting, but there's problem when setting $data =
array('district_id', null);

 

In Java Thrift Server, it receive data as district_id = '' and throws
SQLException (because district_id is int field).

I've test passing null value for $table variable and in the server side it
receive as null value too.

 

Is there something wrong with my thrift map<string, string> ?

 

Regards,

KhoiNM

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message