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

  • SEARCH
  • Home
  • 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 7808957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:17:15+00:00 2026-06-02T03:17:15+00:00

I am finding difficulty on modeling HBase table for the following requirement. I have

  • 0

I am finding difficulty on modeling HBase table for the following requirement.

I have a table ‘Store’ where it stores the store details (Pizza Hut).

I have a table ‘Order’ which has the summary of the transaction (total transaction amount etc…).

I have another table ‘Order_Item’ where every ordered Item in the transaction is stored (This has the item id, item name, item count, tax etc..)

  1. The requirement is, given a time range calculate the total income by a particular order item from a particular Store.

Example : Date Range – Last Week, Store – Pizza A, Item – A, Total Income – 120$

  1. The other requirement is, given a time range calculate the percentage of total income by a particular order item from a store.

Example : Date Range – Last Week, Store – Pizza A, Item – A, %Percentage Income – 23%

I am really stuck on how to model the hbase tables and the deadline makes me tensed.

Please can some one assist me on this.

  • 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-02T03:17:16+00:00Added an answer on June 2, 2026 at 3:17 am

    In HBase, you want to be sure that you design your tables around your typical queries. If you design your tables based on some arbitrary “that makes sense” you are going to see bad performance.

    Since the major requirement is to query by date range / store / item, you want this to be your key. If this is your key, then your queries are going to be fast.

    I suggest you make your key the concatenation of date range + store + item along with some delimiter, e.g.:

    20110103-PIZZAHUT-MEATLOVERS
    20110103-PIZZAHUT-VEGETABLE
    20110104-PIZZAHUT-MEATLOVERS
    20110105-DOMINOS-HAWAIIAN
    

    Then, store each item sold into the first column family as (ID:profit). ID here is something like a unique timestamp, a UUID, a receipt ID, or something.

    For the first query, All you do is do a key lookup on DATE-STORE-ITEM, then sum all of the values you retrieve.

    For the second query, do a range scan from 20110107-PIZZAHUT-! to 20110206-PIZZAHUT-~. Sum the items you are looking for and all the items you are not also. At the end, calculate the percentage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently having difficulty finding a way of making my loops work. I have
Im having difficulty finding an algorithm for the following puzzle- A string is called
I have a great difficulty finding documentation on how to implement internationalization/localization with Apache
I'm not exactly a regex guru, so I have some difficulty finding a regular
I'm have difficulty finding any docs describing Python's expected symlink behavior. I've tried testing
I have a problem and lots of difficulty finding a solution, even if I
I am new to ajax / jquery and have had difficulty finding a simple
I am manually converting code from Java (1.6) to C# and finding some difficulty
I am a beginner in UNIX. I am finding some difficulty in input/output redirection.
Having a bit of difficulty finding out the proper way to mix in code

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.