[
https://issues.apache.org/jira/browse/HIVE-15475?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
pin_zhang updated HIVE-15475:
-----------------------------
Description:
1. start HiveServer2 in apache-hive-1.2.1
2 start a beeline connect to hive server2
ADD JAR ADD JAR
/home/apache-hive-1.2.1-bin/hcatalog/share/hcatalog/hive-hcatalog-core-1.2.1.jar
;
CREATE external TABLE my_table(a string, b bigint)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
STORED AS TEXTFILE
location 'file:///home/hive/json';
3 put a file with more than one new lines at the end of the file
{"a":"a_1", "b" : 1}
4 run sql
select * from my_table ;
+-------------+-------------+--+
| my_table.a | my_table.b |
+-------------+-------------+--+
| a_1 | 1 |
| a_1 | 1 |
| a_1 | 1 |
| a_1 | 1 |
| a_1 | 1 |
+-------------+-------------+--+
was:
1. start HiveServer2 in apache-hive-1.2.1
2 start a beeline connect to hive server2
ADD JAR ADD JAR
/home/apache-hive-1.2.1-bin/hcatalog/share/hcatalog/hive-hcatalog-core-1.2.1.jar
;
CREATE external TABLE my_table(a string, b bigint)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
STORED AS TEXTFILE
location 'file:///home/vitria/json';
3 put a file with more than one new lines at the end of the file
{"a":"a_1", "b" : 1}
4 run sql
select * from my_table ;
+-------------+-------------+--+
| my_table.a | my_table.b |
+-------------+-------------+--+
| a_1 | 1 |
| a_1 | 1 |
| a_1 | 1 |
| a_1 | 1 |
| a_1 | 1 |
+-------------+-------------+--+
> JsonSerDe cannot handle json file with empty lines
> --------------------------------------------------
>
> Key: HIVE-15475
> URL: https://issues.apache.org/jira/browse/HIVE-15475
> Project: Hive
> Issue Type: Bug
> Components: HCatalog
> Affects Versions: 1.2.1
> Reporter: pin_zhang
>
> 1. start HiveServer2 in apache-hive-1.2.1
> 2 start a beeline connect to hive server2
> ADD JAR ADD JAR
> /home/apache-hive-1.2.1-bin/hcatalog/share/hcatalog/hive-hcatalog-core-1.2.1.jar
> ;
> CREATE external TABLE my_table(a string, b bigint)
> ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
> STORED AS TEXTFILE
> location 'file:///home/hive/json';
> 3 put a file with more than one new lines at the end of the file
> {"a":"a_1", "b" : 1}
> 4 run sql
> select * from my_table ;
> +-------------+-------------+--+
> | my_table.a | my_table.b |
> +-------------+-------------+--+
> | a_1 | 1 |
> | a_1 | 1 |
> | a_1 | 1 |
> | a_1 | 1 |
> | a_1 | 1 |
> +-------------+-------------+--+
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)