There are two execution engines available to execute hive queries: 1. Mr 2. Apache Tez set hive . execution . engine = mr set hive . execution . engine = tez 1. Mr: If we set execution engine as mr & executed the query, it will trigger map jobs first & store the result in local disks & the second job have to pick input from the local disk.Because of this the read/write operations show impact on its speed. 2. Apache Tez: If we set execution engine as Tez & executed the query, it uses DAG's i.e.., instead of storing into local disk, it uses in-memory .Hence the read/write operations will be done more faster when compare to Mr. Tez internally triggers Vectorization which helps to increase its process speed. Observe the two images , the time taken for execution of the query using Tez engine is less than time taken by Mr engine.
Loops in Unix You may use different loops based on the situation. They are: #1) Unix For loop statement Example: This program will add 1+2+3+4+5 and result will be 15 for i in 1 2 3 4 5 do sum=`expr $sum + $i` done echo $sum #2) Unix While loop statement Example: This program will print the value of ‘a’ five times, from 1 to 5. a=1 while [ $a -le 5 ] do echo “value of a=” $a a=`expr $a + 1` done #3) Unix Until loop statement This program will print the value of ‘a’ two times from 1 to 2. a=1 until [ $a -ge 3 ] do echo “value of a=” $a a=`expr $a + 1` done While running these loops, there may be a need to break out of the loop in some condition before completing all the iterations or to restart the loop before completing the remaining statements. This can be achieved with the ‘break’ and ‘continue’ statements. The following program illustrates the ‘break’ operation: num=1 while [ $num -le 5 ] do read var if [ $var -lt 0 ] then ...
Unix includes commands for: Testing various conditions associated with specified files. Testing various conditions associated with specified strings. Performing file read/write operations. Arrays Arrays are used to store a series of values in an indexed list. Items in an array are stored and retrieved using an index. Note that Arrays are not supported by the original Bourne Shell, but are supported by bash and other newer shells. File Test Operators Shell scripts often need to check various properties of files as a part of the control flow. Unix provides a number of options for this purpose. File existence checks: -f file True if the file exists and is an ordinary file. -d file True if the file exists and is a directory. -s file True if the file exists and is not empty. -c file True if the file exists and is a character device file. -b file True if the file exists and is a block devise file. File access checks: -r file True if the file exists and has read perm...
Comments
Post a Comment