ZiBaT => Peter
Levinsky => Big Data=> exercise |
|
Updated : 2017-02-23
|
Idea: To have the hadoop (the ligth-version) up and running
Background: You have a Hadoop instance running (see installingHadoop)
the book : Fronter: Big Data Forensics – Learning Hadoop Investigations, Joe Sremack, Packt publishing
In the hive (from ambari)
You are going to use an ODBC driver and Visual Studio
code example ------------------------------:
var conn = new OdbcConnection("DSN=MyHive"); // My ODBC name is 'MyHive'
conn.Open();
var sql = new OdbcCommand("-- some select statement -- ",conn);
Console.WriteLine("Result");
var reader = sql.ExecuteReader();
while (reader.Read())
{
/* Example if table row is (temp int, ligth int, time string)
int temp = reader.GetInt32(0);
int light = reader.GetInt32(1);
string time = reader.GetString(2);
Console.WriteLine($"t={temp} l={light} timestamp={time}");
*/
}
Console.WriteLine("End");
Console.ReadLine();
------------------------------------------------------
Make a progarm in Java preferable (or in C# -- not sure it will work directly) - you can e.g. use Netbeans to develope the program.
You can take the *.jar file move to linux and run as follow: java -jar *.jar
To access look at this example: https://cwiki.apache.org/confluence/display/Hive/HiveClient (some example to Python and PHP as well)
http://stackoverflow.com/questions/10843892/download-large-data-for-hadoop