[ 
https://issues.apache.org/jira/browse/SQOOP-1795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14223158#comment-14223158
 ] 

Qian Xu edited comment on SQOOP-1795 at 11/25/14 7:49 AM:
----------------------------------------------------------

I'd prefer NOT to cache the whole post data in memory, because parameters can 
be retrieved by methods. Actually, if client sends post data as json, the first 
(also the only one) parameter key is the json. {{JSONValue.parse}} accepts 
string. In other words, we have an easy way to retrieve post data rather than 
dealing with the tricky {{getReader}}.

发自我的 iPhone




was (Author: stanleyxu2005):
I'd not prefer to cache the whole post data in memory, while parameters can be 
retrieved by methods.

Actually, if clients sends a json as post data, the first (also the only one) 
parameter key is the json. 

As {{JSONValue.parse}} also accepts string. It will be two line code to get rid 
off {{getReader}}, if I rename my proposed method to {{getFirstParameterName}}. 

发自我的 iPhone



> Sqoop2: Retrieve Http post data in plausible manner
> ---------------------------------------------------
>
>                 Key: SQOOP-1795
>                 URL: https://issues.apache.org/jira/browse/SQOOP-1795
>             Project: Sqoop
>          Issue Type: Sub-task
>            Reporter: Qian Xu
>            Assignee: Qian Xu
>             Fix For: 1.99.5
>
>
> The situation of dealing with the post data is very tricky IMHO. 
> 1. {{getRequest().getReader()}} must be called at the first place. As reading 
> position cannot be reset, you might get unexpected result without notice. 
> SQOOP-1784 is a case of the situation.
> 2. Sqoop client sends post data as a JSON object rather than query string 
> format. Usually it'd suggest to wrap the JSON object as value, and key can be 
> named as "jsonObject". The server will call 
> {{ctx.getParameterValue("jsonObject")}} to get the value.
> I'd suggest to have a {{getRawPostData()}}, so that callers can put finger 
> away from {{getReader()}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to