thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikhil Jindal <nikhiljin...@google.com>
Subject Re: Problem with null value in Thrift map
Date Thu, 24 Jun 2010 12:08:14 GMT
I see no reason why you have 1000 in condition in '', while 1 in data is
not.

On Thu, Jun 24, 2010 at 5:19 PM, Khoi Nguyen Minh <khoinm@dkt.com.vn> wrote:

> 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