columns has 2 elements while hbase.columns.mapping has 3 elements error while creating hive table from hbase












1















I'm getting following error when I run the below command for creating hive table.



sample is my hive table I'm trying to create. hloan is my existing hbase table. Please help.



create external table sample(id int, name string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:id,hl:name")
TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="sample");


ERROR:



FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException org.apache.hadoop.hive.hbase.HBaseSerDe: columns has 2 elements while hbase.columns.mapping has 3 elements (counting the key if implicit))









share|improve this question





























    1















    I'm getting following error when I run the below command for creating hive table.



    sample is my hive table I'm trying to create. hloan is my existing hbase table. Please help.



    create external table sample(id int, name string)
    STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
    WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:id,hl:name")
    TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="sample");


    ERROR:



    FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException org.apache.hadoop.hive.hbase.HBaseSerDe: columns has 2 elements while hbase.columns.mapping has 3 elements (counting the key if implicit))









    share|improve this question



























      1












      1








      1








      I'm getting following error when I run the below command for creating hive table.



      sample is my hive table I'm trying to create. hloan is my existing hbase table. Please help.



      create external table sample(id int, name string)
      STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
      WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:id,hl:name")
      TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="sample");


      ERROR:



      FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException org.apache.hadoop.hive.hbase.HBaseSerDe: columns has 2 elements while hbase.columns.mapping has 3 elements (counting the key if implicit))









      share|improve this question
















      I'm getting following error when I run the below command for creating hive table.



      sample is my hive table I'm trying to create. hloan is my existing hbase table. Please help.



      create external table sample(id int, name string)
      STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
      WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:id,hl:name")
      TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="sample");


      ERROR:



      FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException org.apache.hadoop.hive.hbase.HBaseSerDe: columns has 2 elements while hbase.columns.mapping has 3 elements (counting the key if implicit))






      hive centos hdfs hbase cloudera






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 '18 at 19:11









      Shu

      4,7262418




      4,7262418










      asked Nov 13 '18 at 18:47









      sravan pothurajusravan pothuraju

      82




      82
























          1 Answer
          1






          active

          oldest

          votes


















          0














          As error describes your create external table statement having 2 columns id,name.



          In Hbase mapping you are having 3 columns :key,hl:id,hl:name



          Create table with 3 columns:



          hive> create external table sample(key int, id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:id,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");


          (or)



          if key and id columns having same data then you can skip hl:id in mapping.



          Create table with 2 columns:



          hive> create external table sample(id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");





          share|improve this answer
























          • Thank you so much. It worked.

            – sravan pothuraju
            Nov 13 '18 at 20:20











          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%2f53287652%2fcolumns-has-2-elements-while-hbase-columns-mapping-has-3-elements-error-while-cr%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














          As error describes your create external table statement having 2 columns id,name.



          In Hbase mapping you are having 3 columns :key,hl:id,hl:name



          Create table with 3 columns:



          hive> create external table sample(key int, id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:id,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");


          (or)



          if key and id columns having same data then you can skip hl:id in mapping.



          Create table with 2 columns:



          hive> create external table sample(id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");





          share|improve this answer
























          • Thank you so much. It worked.

            – sravan pothuraju
            Nov 13 '18 at 20:20
















          0














          As error describes your create external table statement having 2 columns id,name.



          In Hbase mapping you are having 3 columns :key,hl:id,hl:name



          Create table with 3 columns:



          hive> create external table sample(key int, id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:id,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");


          (or)



          if key and id columns having same data then you can skip hl:id in mapping.



          Create table with 2 columns:



          hive> create external table sample(id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");





          share|improve this answer
























          • Thank you so much. It worked.

            – sravan pothuraju
            Nov 13 '18 at 20:20














          0












          0








          0







          As error describes your create external table statement having 2 columns id,name.



          In Hbase mapping you are having 3 columns :key,hl:id,hl:name



          Create table with 3 columns:



          hive> create external table sample(key int, id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:id,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");


          (or)



          if key and id columns having same data then you can skip hl:id in mapping.



          Create table with 2 columns:



          hive> create external table sample(id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");





          share|improve this answer













          As error describes your create external table statement having 2 columns id,name.



          In Hbase mapping you are having 3 columns :key,hl:id,hl:name



          Create table with 3 columns:



          hive> create external table sample(key int, id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:id,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");


          (or)



          if key and id columns having same data then you can skip hl:id in mapping.



          Create table with 2 columns:



          hive> create external table sample(id int, name string)
          STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
          WITH SERDEPROPERTIES("hbase.columns.mapping"=":key,hl:name")
          TBLPROPERTIES ("hbase.table.name"="hloan","hbase.mapred.output.outputtable"="hloan");






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 13 '18 at 19:10









          ShuShu

          4,7262418




          4,7262418













          • Thank you so much. It worked.

            – sravan pothuraju
            Nov 13 '18 at 20:20



















          • Thank you so much. It worked.

            – sravan pothuraju
            Nov 13 '18 at 20:20

















          Thank you so much. It worked.

          – sravan pothuraju
          Nov 13 '18 at 20:20





          Thank you so much. It worked.

          – sravan pothuraju
          Nov 13 '18 at 20:20


















          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287652%2fcolumns-has-2-elements-while-hbase-columns-mapping-has-3-elements-error-while-cr%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







          Popular posts from this blog

          The Sandy Post

          Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues

          Fabienne KOHLMANN