phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalyan (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (PHOENIX-3074) Phoenix Bulkload fails when Table name contains '-' (hyphen)
Date Tue, 16 Aug 2016 11:52:20 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-3074?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kalyan reassigned PHOENIX-3074:
-------------------------------

    Assignee: Kalyan

> Phoenix Bulkload fails when Table name contains '-' (hyphen)
> ------------------------------------------------------------
>
>                 Key: PHOENIX-3074
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3074
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.7.0
>            Reporter: Dharmesh
>            Assignee: Kalyan
>              Labels: easyfix, features
>             Fix For: 4.7.0
>
>         Attachments: phoenix_hyphen.patch
>
>
> Bulk load fails from csv to Phoenix table when Phoenix table contains ‘-‘ (hyphen)
in table name. [Phoenix 4.7.0]
> Below is the steps to reproduce the issue.
> Step-1:  create table with '-' hyphen. Use double quote around table name.
> CREATE TABLE "PHOENIX-TEST" (ID INTEGER PRIMARY KEY, NAME VARCHAR);
> Step-2: 
> sudo -u hadoop HADOOP_CLASSPATH=/usr/lib/hbase/hbase-protocol.jar:/usr/lib/hbase/conf/
hadoop jar /usr/lib/phoenix/phoenix-client.jar org.apache.phoenix.mapreduce.CsvBulkLoadTool
-Dfs.permissions.umask-mode=000 -t "PHOENIX-TEST" --input "/user/test/PHOENIX-TEST.csv"  -d
$'\t'
> Below is the stack trace for the error. Ultimately it removes any double or single quotes
around table name from the bulk load command.
> 2016-07-14 10:20:47,153 WARN [main] org.apache.hadoop.metrics2.impl.MetricsSystemImpl:
MapTask metrics system already initialized!
> 2016-07-14 10:20:48,703 INFO [main] org.apache.phoenix.util.UpsertExecutor: Upserting
SQL data with UPSERT  INTO PHOENIX-TEST ("ID", "0"."NAME") VALUES (?, ?)
> 2016-07-14 10:20:48,704 INFO [main] org.apache.hadoop.mapred.MapTask: Starting flush
of map output
> 2016-07-14 10:20:48,711 INFO [main] org.apache.hadoop.io.compress.CodecPool: Got brand-new
compressor [.snappy]
> 2016-07-14 10:20:48,718 WARN [main] org.apache.hadoop.mapred.YarnChild: Exception running
child : java.lang.RuntimeException: org.apache.phoenix.exception.PhoenixParserException: ERROR
601 (42P00): Syntax error. Encountered "-" at line 1, column 17.
> 	at org.apache.phoenix.util.UpsertExecutor.createStatement(UpsertExecutor.java:83)
> 	at org.apache.phoenix.util.UpsertExecutor.<init>(UpsertExecutor.java:94)
> 	at org.apache.phoenix.util.csv.CsvUpsertExecutor.<init>(CsvUpsertExecutor.java:63)
> 	at org.apache.phoenix.mapreduce.CsvToKeyValueMapper.buildUpsertExecutor(CsvToKeyValueMapper.java:85)
> 	at org.apache.phoenix.mapreduce.FormatToBytesWritableMapper.setup(FormatToBytesWritableMapper.java:142)
> 	at org.apache.phoenix.mapreduce.CsvToKeyValueMapper.setup(CsvToKeyValueMapper.java:67)
> 	at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143)
> 	at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:796)
> 	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
> 	at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at javax.security.auth.Subject.doAs(Subject.java:415)
> 	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
> 	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
> Caused by: org.apache.phoenix.exception.PhoenixParserException: ERROR 601 (42P00): Syntax
error. Encountered "-" at line 1, column 17.
> 	at org.apache.phoenix.exception.PhoenixParserException.newException(PhoenixParserException.java:33)
> 	at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:111)
> 	at org.apache.phoenix.jdbc.PhoenixStatement$PhoenixStatementParser.parseStatement(PhoenixStatement.java:1185)
> 	at org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(PhoenixStatement.java:1268)
> 	at org.apache.phoenix.jdbc.PhoenixPreparedStatement.<init>(PhoenixPreparedStatement.java:94)
> 	at org.apache.phoenix.jdbc.PhoenixConnection.prepareStatement(PhoenixConnection.java:715)
> 	at org.apache.phoenix.util.UpsertExecutor.createStatement(UpsertExecutor.java:81)
> 	... 13 more
> Caused by: NoViableAltException(94@[])
> 	at org.apache.phoenix.parse.PhoenixSQLParser.upsert_node(PhoenixSQLParser.java:4723)
> 	at org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(PhoenixSQLParser.java:775)
> 	at org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixSQLParser.java:500)
> 	at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser.java:108)
> 	... 18 more



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message