You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "zhengjiewen (Jira)" <ji...@apache.org> on 2021/02/24 01:52:03 UTC

[jira] [Commented] (PHOENIX-6262) Bulk Load have a bug in lowercase tablename

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

zhengjiewen commented on PHOENIX-6262:
--------------------------------------

create schema "test";


CREATE TABLE IF NOT EXISTS "test"."ods_om_om_order_test" (
"ordercode" VARCHAR NOT NULL,
"cuscode" VARCHAR(50),
"cusname" VARCHAR(50),
"cusgradeid" VARCHAR(50),
"orderstatus" SMALLINT,
"changetype" SMALLINT,
"servicecode" VARCHAR(50),
"salemode" SMALLINT,
"sellercode" VARCHAR(50),
"ordersource" SMALLINT,
"orderchannel" SMALLINT ,
"originorderid" VARCHAR(50),
"payconcode" VARCHAR(50),
"sumamt" decimal(18,4),
"freightcost" decimal(18,4),
"appendfreightcost" decimal(18,4),
"disamt" decimal(18,4),
"couponamt" decimal(18,4),
"pointsamt" decimal(18,4),
"netamt" decimal(18,4),
"unpaidamt" decimal(18,4),
"claimcountamt" decimal(18,4),
"stockstatus" SMALLINT ,
"issplitorder" TINYINT ,
"issplitconsign" TINYINT,
"plansenddate" timestamp,
"sendtime" timestamp,
"sendpriotity" SMALLINT,
"isspectransfer" TINYINT ,
"transfercode" VARCHAR(50),
"orderdesc" VARCHAR(1000),
"remark" VARCHAR(255),
"issuspend" TINYINT,
"suspendtype" VARCHAR(20),
"suspenddesc" VARCHAR(100),
"suspendrelease" timestamp,
"isrx" TINYINT ,
"urgenttype" SMALLINT ,
"invoicetype" SMALLINT,
"shopcode" VARCHAR(50),
"orgcode" VARCHAR(20),
"ip" VARCHAR(50),
"nuid" VARCHAR(255) ,
"sales" VARCHAR(50) ,
"salescode" VARCHAR(50) ,
"creator" VARCHAR(50) ,
"creatorcode" VARCHAR(50),
"createdate" timestamp,
"ischeckmark" TINYINT ,
"iscps" TINYINT  ,
"selecttype" SMALLINT,
"gspshopcode" VARCHAR(50),
"lastmodifytime" timestamp,
"prepayamt" decimal(18,4),
"sellserveramt" decimal(18,4),
"buyserveramt" decimal(18,4),
"isthirdplate" BIGINT,
"rxprocess" BIGINT,
"edittime" timestamp,
"freightinsurance" decimal(5,2) ,
"exchangeinsurance" decimal(5,2) ,
"data_modified_datetime" timestamp,
    "data_op_type" varchar(20),
    "data_op_ts" timestamp,
    CONSTRAINT ODS_OM_OM_ORDER_PK PRIMARY KEY ("ordercode")
) column_encoded_bytes=0,
SALT_BUCKETS = 8;
郑杰文
13437550032@163.com
签名由网易邮箱大师定制
在2020年12月15日 15:49,Chao Wang (Jira)<ji...@apache.org> 写道:

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

Chao Wang 在 PHOENIX-6262中留言:
------------------------------------

hi [~chenyuansheng] , if you could provide your create sql and create schema sql ,I will reproduct greatly. 

Bulk Load have a bug in lowercase tablename
-------------------------------------------

关键字: PHOENIX-6262
URL: https://issues.apache.org/jira/browse/PHOENIX-6262
项目: Phoenix
问题类型: 故障
模块: core
影响版本: 5.0.0
报告人: zhengjiewen
优先级: 重要

h1. Bulk Load in lowercase tablename
{color:#172b4d}when I use phoenix bulk load command to import csv file to phoenix table,{color} there{color:#172b4d} are get error.{color}
{code:java}
//代码占位符
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)
{code}
my command is :
{code:java}
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{code}
{color:#172b4d}And I found the source code have a bug in *org.apache.phoenix.jdbc.PhoenixDatabaseMetaData#*{color}*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_test5"'* so that will can not query the result and then return table not found exception.



--
这条信息是由Atlassian Jira发送的
(v8.3.4#803005)


> Bulk Load have a bug in lowercase tablename
> -------------------------------------------
>
>                 Key: PHOENIX-6262
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6262
>             Project: Phoenix
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 5.0.0
>            Reporter: zhengjiewen
>            Assignee: Chao Wang
>            Priority: Major
>             Fix For: 5.1.0
>
>         Attachments: PHOENIX-6262.master.001.patch, PHOENIX-6262.master.002.patch, PHOENIX-6262.master.003.patch
>
>
> h1. Bulk Load in lowercase tablename
> {color:#172b4d}when I use phoenix bulk load command to import csv file to phoenix table,{color} there{color:#172b4d} are get error.{color}
> {code:java}
> //代码占位符
> 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)
> {code}
> my command is :
> {code:java}
> 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{code}
> {color:#172b4d}And I found the source code have a bug in *org.apache.phoenix.jdbc.PhoenixDatabaseMetaData#*{color}*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.



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