I have sqoopd data from Netezza table and output file is in HDFS, but one column is a timestamp and I want to load it as a date column in my hive table. Using that column I want to create partition on date. How can i do that?

Example: in HDFS data is like = 2013-07-30 11:08:36

In hive I want to load only date (2013-07-30) not timestamps. I want to partition on that column DAILY.

How can I pass partition by column as dynamically?

I have tried with loading data into one table as source. In final table I will do insert overwrite table partition by (date\_column=dynamic date) select \* from table1
['https://Stackoverflow.com/questions/28202116', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4103077/']
Hava a look at this custom Comparator,

put this code after your `while` loop,

```
Collections.sort(Arrays.asList(carList), new Comparator<Car>() {
            @Override
            public int compare(Car o1, Car o2) {
                return Float.compare(o2.myDistance(), o1.myDistance());
            }
        });

```

to print the sorted names along with their rank,

```
        for (Car s : carList){
            System.out.println(s.myDistance() + " " + s.myName());
        }

```

**Output:**

```
THE WINNER OF THE RACE IS:  Andrew Johnson  For team: CocaCola
100.004135 Andrew Johnson
99.623375 Jesus Defualt
99.23477 Andrew Smith
99.20563 Andrew Andrew
98.94183 Jesus Defualt
98.87631 Blondey Gold
98.86331 Jesus Defualt
98.64405 steave smith
98.54269 Jason seglad
98.24685 Bob Joe
98.23995 Andrew Kosevsky
98.06155 Ricky Bobby
97.81364 Jess TheHellItIs
97.77215 Blondey Gold
97.72567 Ashey GirslCanDriveTo
97.57001 Ashey GirslCanDriveTo
97.54619 Cheese farlin
97.29426 Andrew Kralovec
96.68102 Andrew Kosevsky
96.018654 Ashey GirslCanDriveTo

```

to list the first 5 places, use this instead,

```
for (int i=0; i<5; i++){
    System.out.println(carList[i].myDistance() + " " + carList[i].myName() + ", -- Rank: " + (i+1));
}

```

This could be done more easily if you are using Java 8,

```
    Arrays.stream(carList)
            .sorted((a, b) -> Float.compare(b.myDistance(), a.myDistance()))
            .map(c -> c.myDistance() + " " + c.myName())
            .forEachOrdered(System.out::println);

```

This will get you the ranks of all the drivers in descending order along with their respective speed.
your car class could imlpement the Comparable interface :

```
public class Car implements Comparable<Car>

@Override
public int compareTo(Car o) {
    return this.totalOdMiles < o.totalOdMiles ? 0 : 1;
}

```

and the you can sort your array at the end of your while:

```
Arrays.sort(carList);

```

this should somehow work i guess :)