You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Zheng Shao (JIRA)" <ji...@apache.org> on 2008/11/12 02:11:44 UTC

[jira] Commented: (HIVE-15) Create table not accepting COLLECTION ITEM DELIMITER

    [ https://issues.apache.org/jira/browse/HIVE-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646764#action_12646764 ] 

Zheng Shao commented on HIVE-15:
--------------------------------

HI Edward, as of now, we support both a decimal number (ascii code of the separator), or the separator character itself (only if it's not a control character).

There is a test case supporting this and it should be working now:
src/contrib/hive/ql/src/test/queries/clientpositive/input_dynamicserde.q

CREATE TABLE dest1(a array<int>, b array<string>, c map<string,string>, d int, e string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '1'
COLLECTION ITEMS TERMINATED BY '2'
MAP KEYS TERMINATED BY '3'
LINES TERMINATED BY '10'
STORED AS TEXTFILE;

EXPLAIN
FROM src_thrift
INSERT OVERWRITE TABLE dest1 SELECT src_thrift.lint, src_thrift.lstring, src_thrift.mstringstring, src_thrift.aint, src_thrift.astring;

FROM src_thrift
INSERT OVERWRITE TABLE dest1 SELECT src_thrift.lint, src_thrift.lstring, src_thrift.mstringstring, src_thrift.aint, src_thrift.astring;

SELECT dest1.* FROM dest1;

SELECT dest1.a[0], dest1.b[0], dest1.c['key2'], dest1.d, dest1.e FROM dest1;


Please reopen if the problem continue to exist.



> Create table not accepting COLLECTION ITEM DELIMITER
> ----------------------------------------------------
>
>                 Key: HIVE-15
>                 URL: https://issues.apache.org/jira/browse/HIVE-15
>             Project: Hadoop Hive
>          Issue Type: Bug
>         Environment: Using Hive dist from Facebook mirror, not very sure if this is the correct way to file this
>            Reporter: Edward Capriolo
>
> COLLECTION ITEMS TERMINATED BY '\t'; always causes an error regardless of what '\t' '5' '\5' etc.
>  
> hive> create table testlist (id int,name string,favnum ARRAY<int>) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'  COLLECTION ITEMS TERMINATED BY '\t';
> java.lang.NumberFormatException: For input string: "    "
>         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>         at java.lang.Integer.parseInt(Integer.java:447)
>         at java.lang.Byte.parseByte(Byte.java:151)
>         at java.lang.Byte.valueOf(Byte.java:184)
>         at java.lang.Byte.valueOf(Byte.java:208)
>         at org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol.initialize(TCTLSeparatedProtocol.java:316)
>         at org.apache.hadoop.hive.serde2.dynamic_type.DynamicSerDe.initialize(DynamicSerDe.java:85)
>         at org.apache.hadoop.hive.metastore.MetaStoreUtils.getDeserializer(MetaStoreUtils.java:178)
>         at org.apache.hadoop.hive.ql.metadata.Table.initSerDe(Table.java:135)
>         at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:198)
>         at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:205)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:174)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:183)
>         at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:208)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:304)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:155)
>         at org.apache.hadoop.mapred.JobShell.run(JobShell.java:194)
>         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
>         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
>         at org.apache.hadoop.mapred.JobShell.main(JobShell.java:220)
> FAILED: Error in metadata: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:org.apache.hadoop.hive.serde2.SerDeException java.lang.NumberFormatException: For input string: "  ")
> FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
> Time taken: 2.823 seconds

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.