在HDFS中创建zip表

时间:2017-04-12 07:45:45

标签: hadoop mapreduce hdfs impala hadoop-partitioning

我试图创建表格不是这样的拉链。

canvas.toBlob(function(blob) {
   $('#uploader').addBlobs( [blob] )
})

它不是拉链表。我还想创建一个带zip的新表来记录这个表的历史。我怎样才能创建一个带拉链的表?

1 个答案:

答案 0 :(得分:3)

首先设置属性

INSERT INTO backup_table select * from example_table

现在将数据插入备份表

   private void getFollowerList()
{
    if (!Utils.isInternetOn(InviteFriendActivity.this)){
        Utils.showToast(this,getString(R.string.no_internet));
        return;
    }
    progressDialog.show();
    final TwitterSession session = Twitter.getSessionManager()
            .getActiveSession();
    TwitterAuthToken authToken = session.getAuthToken();
    String token = authToken.token;
    String secret = authToken.secret;

//Here we get all the details of user's twitter account
        Call<com.twitter.sdk.android.core.models.User> userCall= Twitter.getApiClient(session).getAccountService()
                .verifyCredentials(true, false);
        userCall.enqueue(new Callback<com.twitter.sdk.android.core.models.User>() {
            @Override
            public void onResponse(Call<com.twitter.sdk.android.core.models.User> call, Response<com.twitter.sdk.android.core.models.User> response) {
                MyTwitterApiClient myTwitterApiClient = new MyTwitterApiClient(session);
                myTwitterApiClient.getCustomService().list(response.body().id).enqueue(new Callback<ResponseBody>() {
                    @Override
                    public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
                        Log.e("list",response.body().toString());
                        BufferedReader reader = null;
                        StringBuilder sb = new StringBuilder();

                        reader = new BufferedReader(new InputStreamReader(response.body().byteStream()));

                        String line;

                        try {
                            while ((line = reader.readLine()) != null) {
                                sb.append(line);
                            }
                        } catch (IOException e) {
                            e.printStackTrace();
                            progressDialog.dismiss();
                        }


                        String result = sb.toString();
                        System.out.println("Response is>>>>>>>>>"+result);
                        JsonObject obj= new Gson().fromJson(result,JsonObject.class);
                        JsonArray usersArray= (JsonArray) obj.get("users");
                        JsonArray userIds = new JsonArray();
                        for(int i=0;i<usersArray.size();i++){
                            JsonObject userObject = (JsonObject) usersArray.get(i);
                            userIds.add(userObject.get("id_str"));
                        }
                        // Api call with Twitter followers ids
                        JsonObject jsonObject = new JsonObject();
                        jsonObject.add("twitter_ids",userIds);

                    }

                    @Override
                    public void onFailure(Call<ResponseBody> call, Throwable t) {
                        Utils.showToast(InviteFriendActivity.this,getString(R.string.something_went_wrong));
                        progressDialog.dismiss();
                    }

                });
            }

            @Override
            public void onFailure(Call<com.twitter.sdk.android.core.models.User> call, Throwable t) {
                Utils.showToast(InviteFriendActivity.this,getString(R.string.something_went_wrong));
                progressDialog.dismiss();
            }
        });
    }

现在数据将转换为Gzip格式