Hive table outdated after Sqoop incremental import










1














I'm trying to do a Sqoop incremental import to a Hive table using "--incremental append".



I did an initial sqoop import and then create a job for the incremental imports.
Both are executed successfully and new files have been added to the same original Hive table directory in HDFS, but when I check my Hive table, the imported observations are not there. The Hive table is equal before the sqoop incremental import.



How can I solve that?
I have about 45 Hive tables and would like to update them daily automatically after the Sqoop incremental import.



First Sqoop Import:



sqoop import 
--connect jdbc:db2://...
--username root
-password 9999999
--class-name db2fcs_cust_atu
--query "SELECT * FROM db2fcs.cust_atu WHERE $CONDITIONS"
--split-by PTC_NR
--fetch-size 10000
--delete-target-dir
--target-dir /apps/hive/warehouse/fcs.db/db2fcs_cust_atu
--hive-import
--hive-table fcs.cust_atu
-m 64;


Then I run Sqoop incremental import:



sqoop job 
-create cli_atu
--import
--connect jdbc:db2://...
--username root
--password 9999999
--table db2fcs.cust_atu
--target-dir /apps/hive/warehouse/fcs.db/db2fcs_cust_atu
--hive-table fcs.cust_atu
--split-by PTC_NR
--incremental append
--check-column TS_CUST
--last-value '2018-09-09'









share|improve this question




























    1














    I'm trying to do a Sqoop incremental import to a Hive table using "--incremental append".



    I did an initial sqoop import and then create a job for the incremental imports.
    Both are executed successfully and new files have been added to the same original Hive table directory in HDFS, but when I check my Hive table, the imported observations are not there. The Hive table is equal before the sqoop incremental import.



    How can I solve that?
    I have about 45 Hive tables and would like to update them daily automatically after the Sqoop incremental import.



    First Sqoop Import:



    sqoop import 
    --connect jdbc:db2://...
    --username root
    -password 9999999
    --class-name db2fcs_cust_atu
    --query "SELECT * FROM db2fcs.cust_atu WHERE $CONDITIONS"
    --split-by PTC_NR
    --fetch-size 10000
    --delete-target-dir
    --target-dir /apps/hive/warehouse/fcs.db/db2fcs_cust_atu
    --hive-import
    --hive-table fcs.cust_atu
    -m 64;


    Then I run Sqoop incremental import:



    sqoop job 
    -create cli_atu
    --import
    --connect jdbc:db2://...
    --username root
    --password 9999999
    --table db2fcs.cust_atu
    --target-dir /apps/hive/warehouse/fcs.db/db2fcs_cust_atu
    --hive-table fcs.cust_atu
    --split-by PTC_NR
    --incremental append
    --check-column TS_CUST
    --last-value '2018-09-09'









    share|improve this question


























      1












      1








      1







      I'm trying to do a Sqoop incremental import to a Hive table using "--incremental append".



      I did an initial sqoop import and then create a job for the incremental imports.
      Both are executed successfully and new files have been added to the same original Hive table directory in HDFS, but when I check my Hive table, the imported observations are not there. The Hive table is equal before the sqoop incremental import.



      How can I solve that?
      I have about 45 Hive tables and would like to update them daily automatically after the Sqoop incremental import.



      First Sqoop Import:



      sqoop import 
      --connect jdbc:db2://...
      --username root
      -password 9999999
      --class-name db2fcs_cust_atu
      --query "SELECT * FROM db2fcs.cust_atu WHERE $CONDITIONS"
      --split-by PTC_NR
      --fetch-size 10000
      --delete-target-dir
      --target-dir /apps/hive/warehouse/fcs.db/db2fcs_cust_atu
      --hive-import
      --hive-table fcs.cust_atu
      -m 64;


      Then I run Sqoop incremental import:



      sqoop job 
      -create cli_atu
      --import
      --connect jdbc:db2://...
      --username root
      --password 9999999
      --table db2fcs.cust_atu
      --target-dir /apps/hive/warehouse/fcs.db/db2fcs_cust_atu
      --hive-table fcs.cust_atu
      --split-by PTC_NR
      --incremental append
      --check-column TS_CUST
      --last-value '2018-09-09'









      share|improve this question















      I'm trying to do a Sqoop incremental import to a Hive table using "--incremental append".



      I did an initial sqoop import and then create a job for the incremental imports.
      Both are executed successfully and new files have been added to the same original Hive table directory in HDFS, but when I check my Hive table, the imported observations are not there. The Hive table is equal before the sqoop incremental import.



      How can I solve that?
      I have about 45 Hive tables and would like to update them daily automatically after the Sqoop incremental import.



      First Sqoop Import:



      sqoop import 
      --connect jdbc:db2://...
      --username root
      -password 9999999
      --class-name db2fcs_cust_atu
      --query "SELECT * FROM db2fcs.cust_atu WHERE $CONDITIONS"
      --split-by PTC_NR
      --fetch-size 10000
      --delete-target-dir
      --target-dir /apps/hive/warehouse/fcs.db/db2fcs_cust_atu
      --hive-import
      --hive-table fcs.cust_atu
      -m 64;


      Then I run Sqoop incremental import:



      sqoop job 
      -create cli_atu
      --import
      --connect jdbc:db2://...
      --username root
      --password 9999999
      --table db2fcs.cust_atu
      --target-dir /apps/hive/warehouse/fcs.db/db2fcs_cust_atu
      --hive-table fcs.cust_atu
      --split-by PTC_NR
      --incremental append
      --check-column TS_CUST
      --last-value '2018-09-09'






      hive hdfs sqoop






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 8 '18 at 3:26









      Gaurang Shah

      3,03211333




      3,03211333










      asked Nov 12 '18 at 23:53









      Fernando SantosFernando Santos

      62




      62






















          1 Answer
          1






          active

          oldest

          votes


















          0














          It might be difficult to understand/answer your question without looking at your full query because your outcome also depends on your choice of arguments and directories. Mind to share your query?






          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271787%2fhive-table-outdated-after-sqoop-incremental-import%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            It might be difficult to understand/answer your question without looking at your full query because your outcome also depends on your choice of arguments and directories. Mind to share your query?






            share|improve this answer

























              0














              It might be difficult to understand/answer your question without looking at your full query because your outcome also depends on your choice of arguments and directories. Mind to share your query?






              share|improve this answer























                0












                0








                0






                It might be difficult to understand/answer your question without looking at your full query because your outcome also depends on your choice of arguments and directories. Mind to share your query?






                share|improve this answer












                It might be difficult to understand/answer your question without looking at your full query because your outcome also depends on your choice of arguments and directories. Mind to share your query?







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 13 '18 at 2:08









                Laenka-OssLaenka-Oss

                915




                915



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271787%2fhive-table-outdated-after-sqoop-incremental-import%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

                    Museum of Modern and Contemporary Art of Trento and Rovereto