[
https://issues.apache.org/jira/browse/CARBONDATA-646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15825525#comment-15825525
]
Ramakrishna commented on CARBONDATA-646:
----------------------------------------
same way this is not handled in Update query, giving in consistent data:
0: jdbc:hive2://172.168.100.212:23040> select * from t_carbn02;
+----------------+---------------+--------------+------------+--+
| active_status | item_type_cd | qty_day_avg | qty_total |
+----------------+---------------+--------------+------------+--+
| TRUE | 0 | 1 | 2 |
+----------------+---------------+--------------+------------+--+
1 row selected (0.088 seconds)
0: jdbc:hive2://172.168.100.212:23040> update t_carbn02 set (item_type_cd) =
(1.3);
+---------+--+
| Result |
+---------+--+
+---------+--+
No rows selected (5.528 seconds)
0: jdbc:hive2://172.168.100.212:23040> select * from t_carbn02;
+----------------+---------------+--------------+------------+--+
| active_status | item_type_cd | qty_day_avg | qty_total |
+----------------+---------------+--------------+------------+--+
| TRUE | 1 | 1 | 2 |
+----------------+---------------+--------------+------------+--+
1 row selected (0.093 seconds)
0: jdbc:hive2://172.168.100.212:23040> update t_carbn02 set (item_type_cd) =
(item_type_cd/2);
+---------+--+
| Result |
+---------+--+
+---------+--+
No rows selected (5.544 seconds)
0: jdbc:hive2://172.168.100.212:23040> select * from t_carbn02;
+----------------+---------------+--------------+------------+--+
| active_status | item_type_cd | qty_day_avg | qty_total |
+----------------+---------------+--------------+------------+--+
| TRUE | 0 | 1 | 2 |
+----------------+---------------+--------------+------------+--+
> Bad record handling is not correct for Int data type
> ----------------------------------------------------
>
> Key: CARBONDATA-646
> URL: https://issues.apache.org/jira/browse/CARBONDATA-646
> Project: CarbonData
> Issue Type: Bug
> Reporter: Ramakrishna
> Priority: Minor
>
> With Bad record handling as default,
> If Char value is given for Int data type, that is handled properly(moving
> NULL).
> If Decimal values is given for Int Data type, it is stripping the decimal,
> where it should consider this as bad record and move NULL.
> Bad record csv:
> TRUE,2.7,423.0,A,200000000003454300,
> 121.5,4.99,2.44,SE3423ee,asfdsffdfg,EtryTRWT,2012-01-12
> 03:14:05.123456729,2012-01-20
> 0: jdbc:hive2://172.168.100.212:23040> select * from t_carbn01 where
> qty_total is NULL;
> +----------------+---------------+--------------+------------+---------------------+--------------+-----------------+---------+------------+-------------+--------------+------------------------+--------------+--+
> | active_status | item_type_cd | qty_day_avg | qty_total | sell_price
> | sell_pricep | discount_price | profit | item_code | item_name |
> outlet_name | update_time | create_date |
> +----------------+---------------+--------------+------------+---------------------+--------------+-----------------+---------+------------+-------------+--------------+------------------------+--------------+--+
> | TRUE | 2 | 423 | NULL |
> 200000000003454304 | 121.5 | 4.99 | 2.44 | SE3423ee |
> asfdsffdfg | EtryTRWT | 2012-01-12 03:14:05.0 | 2012-01-20 |
> +----------------+---------------+--------------+------------+---------------------+--------------+-----------------+---------+------------+-------------+--------------+------------------------+----------
> 0: jdbc:hive2://172.168.100.212:23040> desc t_carbn01;
> +-----------------+---------------+----------+--+
> | col_name | data_type | comment |
> +-----------------+---------------+----------+--+
> | active_status | string | |
> | item_type_cd | bigint | |
> | qty_day_avg | bigint | |
> | qty_total | bigint | |
> | sell_price | bigint | |
> | sell_pricep | double | |
> | discount_price | double | |
> | profit | decimal(3,2) | |
> | item_code | string | |
> | item_name | string | |
> | outlet_name | string | |
> | update_time | timestamp | |
> | create_date | string | |
> +-----------------+---------------+----------+--+
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)