Saturday, October 8, 2016

Get Top N Records per Group

One of the most asked query in the interview,
      how to get top N record in hte each group
      get 15th largest records from DB with out using limit

you can solve above problem statement using rank concept

create a new column in table it will rank your records , by using this rank you can resolve above problem






query and sample dataset  you can get it from the aboe screenshot . and of course result set as well.

basic idea is , creare a session varibale which will increment the rank.
at the end get the result set based on the rank.

Thursday, October 6, 2016

installing oozie eclipse plugin

  launch ecilpse and go to market place
 
  search for oep

  getting below error
  Missing requirement: Oozie Eclipse Plugin requires 'org.eclipse.gef 3.10.0' but it could not be   found
  it claerly tells that, you need to install GEF



 

 
  go to Install new software
  and add  http://download.eclipse.org/tools/gef/updates/releases refer screenshot




  Now you can install OEP






We have done with OEP installation, now we can start with developing workflow

open the palette and you could see the all the item, you can select an item and paste it .



First example of workflow



 
 
 

Stack - an Overview

STACK is the one of the important data structure in the computer science world .
every one should know , how stack DS is implemented in program .

Lets see the below code


int add(int a ,int b)
{
  return a+b ; 


add(3,5) ;  


when add is getting called , we should know ,what is happening internally and what are the information is storing in stack .


If you realize this , then you can understand the risk of using recursive function :)

well, from the above , you can infer , why thread needs separate Stack .

Stack is very simple but from that you can learn more


by the way , Don't think  Stack  is different memory . It is same as Heap , Both memory (Heap and Stack ) taken from RAM .
Small amount of memory is separated and it is surrounded by the Stack DS .   

Tuesday, October 4, 2016

Queue

Another important DS we are going to discuss

QUEUE …

What is queue







See the above Image ,  peoples are standing in the queue and guy in the counter giving tickets or serving something …
Now think , if counter guy able to give ticket  in an ignore time , then do we require queue anymore … No absolutely not .
 But in practical situation, service provider(counter guy) not able to  serve the request (ppl standing in the queue) in an ignore time. So, we need queue in order to serve all the request.

 Queue has a sequence of the request, where which request comes first that will be processed first. And of-course there are some priority queue (this we will discuss later )

Lets see the implementation of the queue (java)   .. it is under construction .. I'll post this soon