Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9181349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:17:32+00:00 2026-06-17T18:17:32+00:00

I have an external table with one column – data, where the data is

  • 0

I have an external table with one column – data, where the data is json object

when I’m running the following hive query

hive> select get_json_object(data, "$.ev") from data_table limit 3;     

Total MapReduce jobs = 1
Launching Job 1 out of 1
Number of reduce tasks is set to 0 since there's no reduce operator
Starting Job = job_201212171824_0218, Tracking URL = http://master:50030/jobdetails.jsp?jobid=job_201212171824_0218
Kill Command = /usr/lib/hadoop/bin/hadoop job  -Dmapred.job.tracker=master:8021 -kill job_201212171824_0218
 2013-01-24 10:41:37,271 Stage-1 map = 0%,  reduce = 0%
 ....
 2013-01-24 10:41:55,549 Stage-1 map = 100%,  reduce = 100%
 Ended Job = job_201212171824_0218
 OK
 2
 2
 2
 Time taken: 21.449 seconds

But when I’m running the sum aggregation the result is strange

hive> select sum(get_json_object(data, "$.ev")) from data_table limit 3;
Total MapReduce 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 mapred.reduce.tasks=<number>
Starting Job = job_201212171824_0217, Tracking URL =   http://master:50030/jobdetails.jsp?jobid=job_201212171824_0217
Kill Command = /usr/lib/hadoop/bin/hadoop job  -Dmapred.job.tracker=master:8021 -kill  job_201212171824_0217
2013-01-24 10:39:24,485 Stage-1 map = 0%,  reduce = 0%
.....
2013-01-24 10:41:00,760 Stage-1 map = 100%,  reduce = 100%
Ended Job = job_201212171824_0217
OK
9.4031522E7
Time taken: 100.416 seconds

Could anyone explain me why is that? And what should I do in for that works properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:17:34+00:00Added an answer on June 17, 2026 at 6:17 pm

    Hive seems to be taking the values in your JSON as floats instead of ints, and it looks like your table is pretty big so Hive is probably using the “exponent” notation for big float numbers, so 9.4031522E7 probably means 94031522.

    If you want to make sure you’re doing a sum over int, you can cast the field of your JSON to int and the sum should be able to return you an int:

    $ hive -e "select sum(get_json_object(dt, '$.ev')) from json_table"
    8.806305E7
    $ hive -e "select sum(cast(get_json_object(dt, '$.ev') as int)) from json_table"
    88063050
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel file that gets external data from database table. I need
I have an entity that maps to an external oracle table which is one
I have a SharePoint external list that points to a 100,000 record SQL table.
I have an external distance object ( gdis ) and need to convert it
I have an external file in php, outputed as json format I want the
I have a HTML table that displays rows of records and has a column
I have an external CSS file which is being imported into one of my
In the `synchro_newitems` table I have all new items (from external source) ~ about
I wish to create an external table in an Oracle database, retrieving its data
I have several external tables used to read file data into the DB each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.