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

IndexTool cannot support tablename lowercase

    XMLWordPrintableJSON

Details

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

    Description

      1. Create table in hbase
      >> create 'ns:phoenix01','info'
      >> put 'ns:phoenix1','row001','info:id','1111'
      >> put 'ns:phoenix1','row001','info:name','manager'

      2. Create table and async index in phoenix
      >> create schema "ns"
      >> create table "ns"."phoenix01"(ROW varchar primary key, "info"."id" varchar, "info"."name" varchar)column_encoded_bytes=0;
      >> create index "phoenix01_index" on "ns"."phoenix01"("info"."name") ASYNC;

      3. Use IndexTool build index
      hbase org.apache.phoenix.mapreduce.index.IndexTool -s "ns" -dt "phoenix01" -it "phoenix01_index" -op /indextest

      Then i get nothing and return directly.

      I check the code and find the error position:

       private boolean isValidIndexTable(final Connection connection, final String masterTable,
                  final String indexTable) throws SQLException {
              final DatabaseMetaData dbMetaData = connection.getMetaData();
              final String schemaName = SchemaUtil.getSchemaNameFromFullName(masterTable);
              final String tableName = SchemaUtil.normalizeIdentifier(SchemaUtil.getTableNameFromFullName(masterTable));
      
              ResultSet rs = null;
              try {
                  rs = dbMetaData.getIndexInfo(null, schemaName, tableName, false, false);
                  while (rs.next()) {
                      final String indexName = rs.getString(6);
                      if (indexTable.equalsIgnoreCase(indexName)) {
                          return true;
                      }
                  }
              } finally {
                  if (rs != null) {
                      rs.close();
                  }
              }
              return false;
          }
      

      I give the lowcase tablename,but indexTool change it uppercase,the validIndexTable get null.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shining shining
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: