Database Reference
In-Depth Information
Query finished, fetching results ...
+----------------------+
| count(distinct make) |
+----------------------+
| 10 |
+----------------------+
Returned 1 row(s) in 0.48s
The preceding distinct SQL command removes the duplicate make values to
make them unique and after that the count SQL command counts all these items to
return the result.
Now, you will see how to use the EXPLAIN clause to understand a query execution
as follows:
[Hadoop.testdomain:21000] > explain select *
from motorcycles where price > 10000 and price
< 20000;
PLAN FRAGMENT 0
PARTITION: UNPARTITIONED
1:EXCHANGE
tuple ids: 0
PLAN FRAGMENT 1
PARTITION: RANDOM
STREAM DATA SINK
EXCHANGE ID: 1
UNPARTITIONED
0:SCAN HDFS
table=autos.motorcycles #partitions=1
size=889B
predicates: price > 10000.0, price <
20000.0
tuple ids: 0
The explain command takes the remaining part of the query and then shows how
it is going to handle the query. If you pass the select command with explain , you
will get results about the query execution plan from the optimizer. Depending upon
Search WWH ::




Custom Search