You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Alexander Pivovarov (JIRA)" <ji...@apache.org> on 2015/05/15 03:18:00 UTC

[jira] [Commented] (HIVE-10616) TypeInfoUtils doesn't handle DECIMAL with just precision specified

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

Alexander Pivovarov commented on HIVE-10616:
--------------------------------------------

I tried to create table with decimal(30) column, load data, select data. Everything works fine.
{code}
hive> create table dec_test (a decimal(30));
OK
Time taken: 0.853 seconds
{code}
{code}
hive> desc dec_test;
OK
a                   	decimal(30,0)       	                    
Time taken: 0.467 seconds, Fetched: 1 row(s)
{code}
{code}
hive> insert into dec_test values (123456789012345);
Query ID = apivovarov_20150514181058_b8de7b66-d691-4a1a-9afa-4a605b2d296a
Total jobs = 3
Launching Job 1 out of 3
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_1431652081178_0001, Tracking URL = http://c11.example.com:8088/proxy/application_1431652081178_0001/
Kill Command = /usr/lib/hadoop-2.6.0/bin/hadoop job  -kill job_1431652081178_0001
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0
2015-05-14 18:11:10,098 Stage-1 map = 0%,  reduce = 0%
2015-05-14 18:11:17,666 Stage-1 map = 100%,  reduce = 0%, Cumulative CPU 1.99 sec
MapReduce Total cumulative CPU time: 1 seconds 990 msec
Ended Job = job_1431652081178_0001
Stage-4 is selected by condition resolver.
Stage-3 is filtered out by condition resolver.
Stage-5 is filtered out by condition resolver.
Moving data to: hdfs://localhost/apps/apivovarov/warehouse/dec_test/.hive-staging_hive_2015-05-14_18-10-58_355_1605293869887130934-1/-ext-10000
Loading data to table default.dec_test
Table default.dec_test stats: [numFiles=1, numRows=1, totalSize=16, rawDataSize=15]
MapReduce Jobs Launched: 
Stage-Stage-1: Map: 1   Cumulative CPU: 1.99 sec   HDFS Read: 3446 HDFS Write: 88 SUCCESS
Total MapReduce CPU Time Spent: 1 seconds 990 msec
OK
Time taken: 21.828 seconds
{code}
{code}
hive> select * from dec_test;
OK
123456789012345
Time taken: 0.144 seconds, Fetched: 1 row(s)
{code}
{code}
hive> select max(*) from dec_test;
FAILED: SemanticException The specified syntax for UDAF invocation is invalid.
hive> select max(a) from dec_test;
Query ID = apivovarov_20150514181227_144b5d8c-c656-4e4e-ae59-696979eef94a
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 1
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
  set mapreduce.job.reduces=<number>
Starting Job = job_1431652081178_0002, Tracking URL = http://c11.example.com:8088/proxy/application_1431652081178_0002/
Kill Command = /usr/lib/hadoop-2.6.0/bin/hadoop job  -kill job_1431652081178_0002
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 1
2015-05-14 18:12:35,733 Stage-1 map = 0%,  reduce = 0%
2015-05-14 18:12:42,277 Stage-1 map = 100%,  reduce = 0%, Cumulative CPU 1.39 sec
2015-05-14 18:12:49,692 Stage-1 map = 100%,  reduce = 100%, Cumulative CPU 3.11 sec
MapReduce Total cumulative CPU time: 3 seconds 110 msec
Ended Job = job_1431652081178_0002
MapReduce Jobs Launched: 
Stage-Stage-1: Map: 1  Reduce: 1   Cumulative CPU: 3.11 sec   HDFS Read: 6866 HDFS Write: 16 SUCCESS
Total MapReduce CPU Time Spent: 3 seconds 110 msec
OK
123456789012345
Time taken: 23.982 seconds, Fetched: 1 row(s)
{code}
{code}
hive> create table dec_test2 like dec_test;
OK
Time taken: 0.117 seconds
{code}
{code}
hive> desc  dec_test2;
OK
a                   	decimal(30,0)       	                    
Time taken: 0.101 seconds, Fetched: 1 row(s)
{code}
{code}
hive> desc formatted dec_test2;
OK
# col_name            	data_type           	comment             
	 	 
a                   	decimal(30,0)       	                    
	 	 
# Detailed Table Information	 	 
Database:           	default             	 
Owner:              	apivovarov          	 
CreateTime:         	Thu May 14 18:13:04 PDT 2015	 
LastAccessTime:     	UNKNOWN             	 
Protect Mode:       	None                	 
Retention:          	0                   	 
Location:           	hdfs://localhost/apps/apivovarov/warehouse/dec_test2	 
Table Type:         	MANAGED_TABLE       	 
Table Parameters:	 	 
	transient_lastDdlTime	1431652384          
	 	 
# Storage Information	 	 
SerDe Library:      	org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe	 
InputFormat:        	org.apache.hadoop.mapred.TextInputFormat	 
OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat	 
Compressed:         	No                  	 
Num Buckets:        	-1                  	 
Bucket Columns:     	[]                  	 
Sort Columns:       	[]                  	 
Storage Desc Params:	 	 
	serialization.format	1                   
Time taken: 0.072 seconds, Fetched: 26 row(s)
{code}

> TypeInfoUtils doesn't handle DECIMAL with just precision specified
> ------------------------------------------------------------------
>
>                 Key: HIVE-10616
>                 URL: https://issues.apache.org/jira/browse/HIVE-10616
>             Project: Hive
>          Issue Type: Bug
>          Components: Serializers/Deserializers
>    Affects Versions: 1.0.0
>            Reporter: Thomas Friedrich
>            Assignee: Thomas Friedrich
>            Priority: Minor
>         Attachments: HIVE-10616.1.patch
>
>
> The parseType method in TypeInfoUtils doesn't handle decimal types with just precision specified although that's a valid type definition. 
> As a result, TypeInfoUtils.getTypeInfoFromTypeString will always return decimal(10,0) for any decimal(<precision>) string. 



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