[
https://issues.apache.org/jira/browse/PIG-4620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14618946#comment-14618946
]
Andi Chirita commented on PIG-4620:
-----------------------------------
There are actually 2 Exceptions that I'm getting when trying to set table
namespace :
1) Loading HBase table with schema :
{code}
raw = LOAD 'hbase://SampleNamespace:SampleTableCopy'
USING org.apache.pig.backend.hadoop.hbase.HBaseStorage(
'info:first_name info:last_name friends:* info:*', '-loadKey true -limit
5')
AS (id:bytearray, first_name:chararray, last_name:chararray,
friends_map:map[], info_map:map[]);
{code}
{code}
2015-07-08 19:40:47,789 [main] ERROR
org.apache.hadoop.hbase.mapreduce.TableInputFormat -
java.lang.IllegalArgumentException: Illegal character code:58, <:> at 15.
User-space table qualifiers can only contain 'alphanumeric characters': i.e.
[a-zA-Z_0-9-.]: SampleNamespace:SampleTableCopy
at
org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:195)
at
org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:149)
at org.apache.hadoop.hbase.TableName.<init>(TableName.java:308)
at
org.apache.hadoop.hbase.TableName.createTableNameIfNecessary(TableName.java:344)
at org.apache.hadoop.hbase.TableName.valueOf(TableName.java:435)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:160)
at
org.apache.hadoop.hbase.mapreduce.TableInputFormat.setConf(TableInputFormat.java:101)
at
org.apache.pig.backend.hadoop.hbase.HBaseTableInputFormat$HBaseTableIFBuilder.build(HBaseTableInputFormat.java:78)
at
org.apache.pig.backend.hadoop.hbase.HBaseStorage.getInputFormat(HBaseStorage.java:679)
at org.apache.pig.impl.io.ReadToEndLoader.init(ReadToEndLoader.java:188)
at
org.apache.pig.impl.io.ReadToEndLoader.<init>(ReadToEndLoader.java:146)
at
org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLoad.setUp(POLoad.java:95)
at
org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLoad.getNextTuple(POLoad.java:123)
at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.runPipeline(PigGenericMapBase.java:282)
at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:277)
at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:64)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
at
org.apache.pig.pen.LocalMapReduceSimulator.launchPig(LocalMapReduceSimulator.java:202)
at
org.apache.pig.pen.ExampleGenerator.getData(ExampleGenerator.java:257)
at
org.apache.pig.pen.ExampleGenerator.readBaseData(ExampleGenerator.java:222)
at
org.apache.pig.pen.ExampleGenerator.getExamples(ExampleGenerator.java:154)
at org.apache.pig.PigServer.getExamples(PigServer.java:1238)
at
org.apache.pig.tools.grunt.GruntParser.processIllustrate(GruntParser.java:831)
at
org.apache.pig.tools.pigscript.parser.PigScriptParser.Illustrate(PigScriptParser.java:802)
at
org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:381)
at
org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:198)
at
org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:173)
at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
at org.apache.pig.Main.run(Main.java:478)
at org.apache.pig.Main.main(Main.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
{code}
2) Loading table without schema
{code}
raw = LOAD 'SampleNamespace:SampleTableCopy'
USING org.apache.pig.backend.hadoop.hbase.HBaseStorage(
'info:first_name info:last_name friends:* info:*', '-loadKey true -limit
5')
AS (id:bytearray, first_name:chararray, last_name:chararray,
friends_map:map[], info_map:map[]);
{code}
{code}
2015-07-08 19:54:33,140 [main] ERROR org.apache.pig.PigServer - exception
during parsing: Error during parsing. Pig script failed to parse:
<file /andic/scripts/pig/TestCustomHBaseStorageNS.pig, line 6, column 14> pig
script failed to validate: java.lang.IllegalArgumentException:
java.net.URISyntaxException: Relative path in absolute URI:
SampleNamespace:SampleTableCopy
Failed to parse: Pig script failed to parse:
{code}
> Add namespace support to HBaseStorage
> -------------------------------------
>
> Key: PIG-4620
> URL: https://issues.apache.org/jira/browse/PIG-4620
> Project: Pig
> Issue Type: New Feature
> Affects Versions: 0.15.0
> Reporter: Andi Chirita
> Assignee: Andi Chirita
> Labels: hbase, patch
> Attachments: HBaseStorageNamespace.patch
>
>
> Since version 0.96 HBase introduced namespace support.
> Apace Pig has recently updated the HBase dependency to 0.98.12 (PIG-4544)
> Currently there's no way to specify the namespace for a table.
> I suggest to implement it is using a '-namespace' option.
> {code}
> copy = STORE raw INTO 'hbase://SampleTableCopy'
> USING org.apache.pig.backend.hadoop.hbase.HBaseStorage(
> 'info:first_name info:last_name friends:* info:*','-namespace
> SampleNamespace');
> {code}
> We can't use the namespace in the hbase path as it will break the uri
> validation : 'hbase://SampleNamespace:SampleTableCopy'
> The patch is available. I will look to extend the unittest for the namespace
> option.
> Please review my changes and let me know if I can help with something.
> Kind regard,
> Andi
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)