how to insert a column in hive table by taking unique values from 5 different column in another hive table

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

up vote
0
down vote

favorite

I have a hive table with the below schema.

Table A:

`li_number string

id1 string

id2 string

id3 string

id4 string

id5 string

id6 string

id7 string

id8 string

id9 string

id10 string

created_date date`

Table B:

`id string

created_date date`

From table A, i need to take unique id’s from id1 to id10 and load them in table B id column. Also i need to load created date column with the current date of loading

I have achieved the same using an shell script and load statement of hive. but i need this to be done using only hive. Please help me.

share

    up vote
    0
    down vote

    favorite

    I have a hive table with the below schema.

    Table A:

    `li_number string

    id1 string

    id2 string

    id3 string

    id4 string

    id5 string

    id6 string

    id7 string

    id8 string

    id9 string

    id10 string

    created_date date`

    Table B:

    `id string

    created_date date`

    From table A, i need to take unique id’s from id1 to id10 and load them in table B id column. Also i need to load created date column with the current date of loading

    I have achieved the same using an shell script and load statement of hive. but i need this to be done using only hive. Please help me.

    share

      up vote
      0
      down vote

      favorite

      up vote
      0
      down vote

      favorite

      I have a hive table with the below schema.

      Table A:

      `li_number string

      id1 string

      id2 string

      id3 string

      id4 string

      id5 string

      id6 string

      id7 string

      id8 string

      id9 string

      id10 string

      created_date date`

      Table B:

      `id string

      created_date date`

      From table A, i need to take unique id’s from id1 to id10 and load them in table B id column. Also i need to load created date column with the current date of loading

      I have achieved the same using an shell script and load statement of hive. but i need this to be done using only hive. Please help me.

      share

      I have a hive table with the below schema.

      Table A:

      `li_number string

      id1 string

      id2 string

      id3 string

      id4 string

      id5 string

      id6 string

      id7 string

      id8 string

      id9 string

      id10 string

      created_date date`

      Table B:

      `id string

      created_date date`

      From table A, i need to take unique id’s from id1 to id10 and load them in table B id column. Also i need to load created date column with the current date of loading

      I have achieved the same using an shell script and load statement of hive. but i need this to be done using only hive. Please help me.

      load apache-hive

      share

      share

      share

      share

      asked 2 mins ago

      akr

      34

      34

          active

          oldest

          votes

          Your Answer

          StackExchange.ready(function() {
          var channelOptions = {
          tags: “”.split(” “),
          id: “106”
          };
          initTagRenderer(“”.split(” “), “”.split(” “), channelOptions);

          StackExchange.using(“externalEditor”, function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using(“snippets”, function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: ‘answer’,
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: “”,
          onDemand: true,
          discardSelector: “.discard-answer”
          ,immediatelyShowMarkdownHelp:true
          });

          }
          });

           
          draft saved
          draft discarded

          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin(‘.new-post-login’, ‘https%3a%2f%2funix.stackexchange.com%2fquestions%2f477896%2fhow-to-insert-a-column-in-hive-table-by-taking-unique-values-from-5-different-co%23new-answer’, ‘question_page’);
          }
          );

          Post as a guest

          active

          oldest

          votes

          active

          oldest

          votes

          active

          oldest

          votes

          active

          oldest

          votes

           
          draft saved
          draft discarded

           

          draft saved

          draft discarded

          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin(‘.new-post-login’, ‘https%3a%2f%2funix.stackexchange.com%2fquestions%2f477896%2fhow-to-insert-a-column-in-hive-table-by-taking-unique-values-from-5-different-co%23new-answer’, ‘question_page’);
          }
          );

          Post as a guest

          Related Post

          Leave a Reply

          Your email address will not be published. Required fields are marked *