Skip to content

Commit

Permalink
HIVE-28076: Selecting data from a bucketed table with decimal column …
Browse files Browse the repository at this point in the history
…type throwing NPE. (Dayakar M, reviewed by Krisztian Kasa)

(cherry picked from commit 3e48a01)
  • Loading branch information
mdayakar authored and deniskuzZ committed Mar 5, 2024
1 parent d24764a commit 1c36cf4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected void generatePredicate(NodeProcessorCtx procCtx,
BitSet bs = new BitSet(numBuckets);
bs.clear();
PrimitiveObjectInspector bucketOI = (PrimitiveObjectInspector)bucketField.getFieldObjectInspector();
PrimitiveObjectInspector constOI = PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(bucketOI.getPrimitiveCategory());
PrimitiveObjectInspector constOI = PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(bucketOI.getTypeInfo());
// Fetch the bucketing version from table scan operator
int bucketingVersion = top.getConf().getTableMetadata().getBucketingVersion();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set hive.tez.bucket.pruning=true;

create table bucket_table(id decimal(38,0), name string) clustered by(id) into 3 buckets;
insert into bucket_table values(5000000000000999640711, 'Cloud');

select * from bucket_table bt where id = 5000000000000999640711;
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
PREHOOK: query: create table bucket_table(id decimal(38,0), name string) clustered by(id) into 3 buckets
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@bucket_table
POSTHOOK: query: create table bucket_table(id decimal(38,0), name string) clustered by(id) into 3 buckets
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@bucket_table
PREHOOK: query: insert into bucket_table values(5000000000000999640711, 'Cloud')
PREHOOK: type: QUERY
PREHOOK: Input: _dummy_database@_dummy_table
PREHOOK: Output: default@bucket_table
POSTHOOK: query: insert into bucket_table values(5000000000000999640711, 'Cloud')
POSTHOOK: type: QUERY
POSTHOOK: Input: _dummy_database@_dummy_table
POSTHOOK: Output: default@bucket_table
POSTHOOK: Lineage: bucket_table.id SCRIPT []
POSTHOOK: Lineage: bucket_table.name SCRIPT []
PREHOOK: query: select * from bucket_table bt where id = 5000000000000999640711
PREHOOK: type: QUERY
PREHOOK: Input: default@bucket_table
#### A masked pattern was here ####
POSTHOOK: query: select * from bucket_table bt where id = 5000000000000999640711
POSTHOOK: type: QUERY
POSTHOOK: Input: default@bucket_table
#### A masked pattern was here ####
5000000000000999640711 Cloud

0 comments on commit 1c36cf4

Please sign in to comment.