Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-6262

Bulk Load have a bug in lowercase tablename

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0.0
    • None
    • core
    • None

    Description

      Bulk Load in lowercase tablename

      when I use phoenix bulk load command to import csv file to phoenix table, there are get error.

      //代码占位符
      Exception in thread "main" java.lang.IllegalArgumentException: Table "test"."ods_om_om_order_test" not foundException in thread "main" java.lang.IllegalArgumentException: Table "test"."ods_om_om_order_test" not found at org.apache.phoenix.util.SchemaUtil.generateColumnInfo(SchemaUtil.java:956) at org.apache.phoenix.mapreduce.AbstractBulkLoadTool.buildImportColumns(AbstractBulkLoadTool.java:377) at org.apache.phoenix.mapreduce.AbstractBulkLoadTool.loadData(AbstractBulkLoadTool.java:211) at org.apache.phoenix.mapreduce.AbstractBulkLoadTool.run(AbstractBulkLoadTool.java:180) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90) at org.apache.phoenix.mapreduce.CsvBulkLoadTool.main(CsvBulkLoadTool.java:109) 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:313) at org.apache.hadoop.util.RunJar.main(RunJar.java:227)
      

      my command is :

      hadoop jar /opt/cloudera/parcels/CDH/lib/hbase/lib/phoenix-5.0.0-cdh6.2.0-client.jar org.apache.phoenix.mapreduce.CsvBulkLoadTool -s \"\"test\"\" -t \"\"ods_om_om_order_test\"\" -i /tmp/phoenix/ods_om_om_order_test5/data.csv

      And I found the source code have a bug in org.apache.phoenix.jdbc.PhoenixDatabaseMetaData#getColumns.

      This method splices the tableName and schemaName into SQL statements to query the System.catalog. but if your tableName or schemaName is lowercase,that would be the '"test"' and '"ods_om_om_order_test"' so that will can not query the result and then return table not found exception.

      Attachments

        1. PHOENIX-6262.master.001.patch
          9 kB
          Chao Wang
        2. PHOENIX-6262.master.002.patch
          10 kB
          Chao Wang
        3. PHOENIX-6262.master.003.patch
          28 kB
          Chao Wang

        Issue Links

          Activity

            People

              richardantal Richárd Antal
              zhengjiewen zhengjiewen
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: