[ 
https://issues.apache.org/jira/browse/PHOENIX-4526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16363640#comment-16363640
 ] 

Sergey Soldatov commented on PHOENIX-4526:
------------------------------------------

phoenix.rowkeys specifies *Hive* columns. all Hive columns are lowercase and 
should be specified in that way.

> PhoenixStorageHandler doesn't work with upper case in phoenix.rowkeys
> ---------------------------------------------------------------------
>
>                 Key: PHOENIX-4526
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4526
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Choi JaeHwan
>            Priority: Major
>              Labels: HivePhoenix
>         Attachments: PHOENIX-4526.patch
>
>
> If you write phoenix rowkey in uppercase, you will get the following error.
> The field column name changes from hive to lowercase, but not to the 
> phoenix.rowkeys property.
> {code}
> CREATE TABLE `PROFILE_PHOENIX_CLONE4` (
>       USER_ID STRING COMMENT 'from deserializer'
>       ,MARRIED STRING COMMENT 'from deserializer'
>       ,USER_NAME STRING COMMENT 'from deserializer'
>       ,BIRTH STRING COMMENT 'from deserializer'
>       ,WEIGHT FLOAT COMMENT 'from deserializer'
>       ,HEIGHT DOUBLE COMMENT 'from deserializer'
>       ,CHILD STRING COMMENT 'from deserializer'
>       ,IS_MALE BOOLEAN COMMENT 'from deserializer'
>       ,PHONE STRING COMMENT 'from deserializer'
>       ,EMAIL STRING COMMENT 'from deserializer'
>       ,CREATE_TIME TIMESTAMP COMMENT 'from deserializer'
> ) COMMENT '한글 HBase 테이블'
> STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler' 
> TBLPROPERTIES (
>       "phoenix.table.name"="jackdb_PROFILE_PHOENIX_CLONE4"
>       ,"phoenix.zookeeper.quorum"="qa3.nexr.com,qa4.nexr.com,qa5.nexr.com"
>       ,"phoenix.rowkeys"="USER_ID,MARRIED"
>       ,"phoenix.zookeeper.client.port"="2181"
>       ,"phoenix.zookeeper.znode.parent"="/hbase"
>       
> ,"phoenix.column.mapping"="USER_ID:USER_ID,MARRIED:MARRIED,USER_NAME:USER_NAME,BIRTH:BIRTH,WEIGHT:WEIGHT,HEIGHT:HEIGHT,CHILD:CHILD,IS_MALE:IS_MALE,PHONE:PHONE,EMAIL:EMAIL,CREATE_TIME:CREATE_TIME"
>       ,"ndap.table.storageType"="PHOENIX"
>       ,"phoenix.table.options"="SALT_BUCKETS=10,DATA_BLOCK_ENCODING='DIFF'"
> )
> {code}
> {code}
> 2018-01-04T10:37:50,186 INFO  [HiveServer2-Background-Pool: Thread-10310]: 
> ql.Driver (Driver.java:execute(1735)) - Executing 
> command(queryId=hive_20180104103750_424baf0b-141a-450c-ae78-8f9be8a743a8): 
> CREATE TABLE `jackdb`.`PROFILE_PHOENIX_CLONE4` (
>       USER_ID STRING COMMENT 'from deserializer'
>       ,MARRIED STRING COMMENT 'from deserializer'
>       ,USER_NAME STRING COMMENT 'from deserializer'
>       ,BIRTH STRING COMMENT 'from deserializer'
>       ,WEIGHT FLOAT COMMENT 'from deserializer'
>       ,HEIGHT DOUBLE COMMENT 'from deserializer'
>       ,CHILD STRING COMMENT 'from deserializer'
>       ,IS_MALE BOOLEAN COMMENT 'from deserializer'
>       ,PHONE STRING COMMENT 'from deserializer'
>       ,EMAIL STRING COMMENT 'from deserializer'
>       ,CREATE_TIME TIMESTAMP COMMENT 'from deserializer'
> ) COMMENT '한글 HBase 테이블'
> STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler' 
> TBLPROPERTIES (
>       "phoenix.table.name"="jackdb_PROFILE_PHOENIX_CLONE4"
>       ,"phoenix.zookeeper.quorum"="qa3.nexr.com,qa4.nexr.com,qa5.nexr.com"
>       ,"phoenix.rowkeys"="USER_ID,MARRIED"
>       ,"phoenix.zookeeper.client.port"="2181"
>       ,"phoenix.zookeeper.znode.parent"="/hbase"
>       
> ,"phoenix.column.mapping"="USER_ID:USER_ID,MARRIED:MARRIED,USER_NAME:USER_NAME,BIRTH:BIRTH,WEIGHT:WEIGHT,HEIGHT:HEIGHT,CHILD:CHILD,IS_MALE:IS_MALE,PHONE:PHONE,EMAIL:EMAIL,CREATE_TIME:CREATE_TIME"
>       ,"ndap.table.storageType"="PHOENIX"
>       ,"phoenix.table.options"="SALT_BUCKETS=10,DATA_BLOCK_ENCODING='DIFF'"
> )
> 2018-01-04T10:37:50,189 INFO  [HiveServer2-Background-Pool: Thread-10310]: 
> ql.Driver (Driver.java:launchTask(2181)) - Starting task [Stage-0:DDL] in 
> serial mode
> 2018-01-04T10:37:50,224 INFO  [HiveServer2-Background-Pool: Thread-10310]: 
> plan.CreateTableDesc (CreateTableDesc.java:toTable(717)) - Use 
> StorageHandler-supplied org.apache.phoenix.hive.PhoenixSerDe for table 
> PROFILE_PHOENIX_CLONE4
> 2018-01-04T10:37:50,225 INFO  [HiveServer2-Background-Pool: Thread-10310]: 
> exec.DDLTask (DDLTask.java:createTable(4324)) - creating table 
> jackdb.PROFILE_PHOENIX_CLONE4 on null
> 2018-01-04T10:37:50,294 ERROR [HiveServer2-Background-Pool: Thread-10310]: 
> exec.DDLTask (DDLTask.java:failed(639)) - 
> org.apache.hadoop.hive.ql.metadata.HiveException: 
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>       at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:862)
>       at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:867)
>       at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:4356)
>       at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:354)
>       at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:199)
>       at 
> org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100)
>       at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2183)
>       at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1839)
>       at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1526)
>       at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
>       at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1232)
>       at 
> org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:255)
>       at 
> org.apache.hive.service.cli.operation.SQLOperation.access$800(SQLOperation.java:91)
>       at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:348)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at javax.security.auth.Subject.doAs(Subject.java:422)
>       at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1746)
>       at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:362)
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>       at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
> range: -1
>       at 
> java.lang.AbstractStringBuilder.deleteCharAt(AbstractStringBuilder.java:824)
>       at java.lang.StringBuilder.deleteCharAt(StringBuilder.java:253)
>       at 
> org.apache.phoenix.hive.PhoenixMetaHook.createTableStatement(PhoenixMetaHook.java:157)
>       at 
> org.apache.phoenix.hive.PhoenixMetaHook.preCreateTable(PhoenixMetaHook.java:75)
>       at 
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:747)
>       at 
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:740)
>       at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:173)
>       at com.sun.proxy.$Proxy51.createTable(Unknown Source)
>       at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:852)
>       ... 22 more
> 2018-01-04T10:37:50,295 ERROR [HiveServer2-Background-Pool: Thread-10310]: 
> ql.Driver (SessionState.java:printError(1126)) - FAILED: Execution Error, 
> return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. 
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> 2018-01-04T10:37:50,296 INFO  [HiveServer2-Background-Pool: Thread-10310]: 
> ql.Driver (Driver.java:execute(2050)) - Completed executing 
> command(queryId=hive_20180104103750_424baf0b-141a-450c-ae78-8f9be8a743a8); 
> Time taken: 0.11 seconds
> 2018-01-04T10:37:50,298 ERROR [HiveServer2-Background-Pool: Thread-10310]: 
> operation.Operation (SQLOperation.java:run(352)) - Error running hive query: 
> org.apache.hive.service.cli.HiveSQLException: Error while processing 
> statement: FAILED: Execution Error, return code 1 from 
> org.apache.hadoop.hive.ql.exec.DDLTask. 
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>       at 
> org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:380)
>  ~[hive-service-2.3.2.jar:2.3.2]
>       at 
> org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:257)
>  ~[hive-service-2.3.2.jar:2.3.2]
>       at 
> org.apache.hive.service.cli.operation.SQLOperation.access$800(SQLOperation.java:91)
>  ~[hive-service-2.3.2.jar:2.3.2]
>       at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:348)
>  [hive-service-2.3.2.jar:2.3.2]
>       at java.security.AccessController.doPrivileged(Native Method) 
> ~[?:1.8.0_151]
>       at javax.security.auth.Subject.doAs(Subject.java:422) [?:1.8.0_151]
>       at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1746)
>  [hadoop-common-2.7.4.jar:?]
>       at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:362)
>  [hive-service-2.3.2.jar:2.3.2]
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> [?:1.8.0_151]
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
> [?:1.8.0_151]
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  [?:1.8.0_151]
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  [?:1.8.0_151]
>       at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
> Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: 
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>       at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:862) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:867) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at 
> org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:4356) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:354) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:199) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at 
> org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2183) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1839) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1526) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1232) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at 
> org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:255)
>  ~[hive-service-2.3.2.jar:2.3.2]
>       ... 11 more
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
> range: -1
>       at 
> java.lang.AbstractStringBuilder.deleteCharAt(AbstractStringBuilder.java:824) 
> ~[?:1.8.0_151]
>       at java.lang.StringBuilder.deleteCharAt(StringBuilder.java:253) 
> ~[?:1.8.0_151]
>       at 
> org.apache.phoenix.hive.PhoenixMetaHook.createTableStatement(PhoenixMetaHook.java:157)
>  ~[phoenix-4.12.0-HBase-1.2-hive.jar:?]
>       at 
> org.apache.phoenix.hive.PhoenixMetaHook.preCreateTable(PhoenixMetaHook.java:75)
>  ~[phoenix-4.12.0-HBase-1.2-hive.jar:?]
>       at 
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:747)
>  ~[hive-exec-2.3.2.jar:2.3.2]
>       at 
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:740)
>  ~[hive-exec-2.3.2.jar:2.3.2]
>       at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source) ~[?:?]
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[?:1.8.0_151]
>       at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
>       at 
> org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:173)
>  ~[hive-exec-2.3.2.jar:2.3.2]
>       at com.sun.proxy.$Proxy51.createTable(Unknown Source) ~[?:?]
>       at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:852) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:867) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at 
> org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:4356) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:354) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:199) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at 
> org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2183) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1839) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1526) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1232) 
> ~[hive-exec-2.3.2.jar:2.3.2]
>       at 
> org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:255)
>  ~[hive-service-2.3.2.jar:2.3.2]
>       ... 11 more
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to