Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-16944

schematool -dbType hive should give some more feedback/assistance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • None

    Description

      Given the other ways schematool is used, the most obvious guess I would have for initializing the Hive schema is:

      schematool -metaDbType mysql -dbType hive -initSchema
      

      Unfortunately that fails with this NPE:

      Exception in thread "main" java.lang.NullPointerException
      	at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getDbCommandParser(HiveSchemaHelper.java:570)
      	at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getDbCommandParser(HiveSchemaHelper.java:564)
      	at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getDbCommandParser(HiveSchemaHelper.java:560)
      	at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper$HiveCommandParser.<init>(HiveSchemaHelper.java:373)
      	at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getDbCommandParser(HiveSchemaHelper.java:573)
      	at org.apache.hive.beeline.HiveSchemaTool.getDbCommandParser(HiveSchemaTool.java:165)
      	at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:101)
      	at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:90)
      	at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1166)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
      	at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
      

      Two additional arguments are needed:
      -url jdbc:hive2://localhost:10000/default -driver org.apache.hive.jdbc.HiveDriver

      If the user does not supply these for dbType hive, schematool should detect and error out appropriately, plus give an example of what it's looking for.

      Attachments

        1. HIVE-16944.1.patch
          1 kB
          Bharath Krishna

        Issue Links

          Activity

            People

              bharos92 Bharath Krishna
              cartershanklin Carter Shanklin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: