1)from_unixtime: This function converts the number of seconds from unix epoch (1970-01-01 00:00:00 UTC) to a STRING that represents the TIMESTAMP of that moment in the current system time zone in the format of “1970-01-01 00:00:00”. The following example returns the current date including the time. hive> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP()); OK 2015–05–18 05:43:37 Time […]
Hive installation: 1.) search for apache hive-2.2.0 bin in google and download zar file (latest bin.tar.gz file) http://www-eu.apache.org/dist/hive/hive-2.2.0/ e.g. :- apache-hive-2.2.0-bin.tar.gz or download hive from linux command as below:– wget http://www-eu.apache.org/dist/hive/hive-2.2.0/apache-hive-2.2.0-bin.tar.gz 2.) extract file: tar -xvf <filename> e.g.:-tar -xvf apache-hive-2.2.0-bin.tar.gz mv apache-hive-2.2.0-bin hive2 3.) download mysqlconnector by using below command wget https://la-mirrors.evowise.com/mysql/Downloads/Connector-J/mysql-connector-java-5.1.45.tar.gz extract file : […]
HDFS commands 1)mkdir (Create a directory) hadoop fs –mkdir /data 2)copyFromLocal(Copy a file or directory from Local to HDFS) If we want to copy file1 from local to HDFS inside directory /data then we have to use below command hadoop fs –copyFromLocal file1 /data/ Note: Can be used for copying multiple files, similar pattern files, […]