Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Hive BIGINT vs INT storage and performance?

avatar
New Member

If I'm having a column with BIGINT as datatype and it's having a value in INT's range, then will it take all the 8bytes or just 4bytes for storing?

,

what about BIGINT and INT?

for example if I'm having a column with BIGINT as datatype and I'm inserting value in INT's range, will it take 8byte(as for BIGINT) or just 4bytes considering it is in INT range?

1 ACCEPTED SOLUTION

avatar
Master Mentor
@Gunjan Dhawas

based by the wiki, it will take 8 bytes.

INT/INTEGER (4-byte signed integer, from -2,147,483,648 to 2,147,483,647)
BIGINT (8-byte signed integer, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-IntegralTy...

and https://cwiki.apache.org/confluence/display/Hive/Tutorial#Tutorial-TypeSystem

View solution in original post

1 REPLY 1

avatar
Master Mentor
@Gunjan Dhawas

based by the wiki, it will take 8 bytes.

INT/INTEGER (4-byte signed integer, from -2,147,483,648 to 2,147,483,647)
BIGINT (8-byte signed integer, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-IntegralTy...

and https://cwiki.apache.org/confluence/display/Hive/Tutorial#Tutorial-TypeSystem