shining created PHOENIX-5834:
--------------------------------

             Summary: IndexTool cannot support tablename lowercase 
                 Key: PHOENIX-5834
                 URL: https://issues.apache.org/jira/browse/PHOENIX-5834
             Project: Phoenix
          Issue Type: Bug
          Components: core
    Affects Versions: 5.0.0
            Reporter: shining


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:

{code:java}
 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;
    }
{code}

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






--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to