|
|
|
|
- Overview
- How to handle a database with Hive in programming?
Managing Hive databases
Available only with these kinds of connection
Hive is a software layer of Hadoop used to run queries. Hive is using the HiveQL language that is close to SQL. The developer specifies his query by using HiveQL (syntax derived from SQL) and the Hive engine translates this query to interrogate the HBase database in native mode.. In version 21, you have the ability to run HiveQL queries by using the SQL functions of WLanguage. How to handle a database with Hive in programming? To handle a database with Hive, you must use the SQL functions of WLanguage. You can: ConnectionNum is int ConnectionNum = SQLConnect("master2.hadoop1.myserver.com", "sa", "", "default", "HIVE") IF ConnectionNum <> 0 THEN // The connection was successful // Use the connection to run SQL queries IF SQLExec("SELECT * FROM TEAM WHERE NAME='HOU'") = True THEN // Process the query ELSE // Query failure: display an error message SQLInfo("FINDCUSTOMERBYNAME") Error("Error" + SQL.Error + "in the query: ", SQL.MesError) END ELSE // The connection failed: display an error message SQLInfo() Error("The connection to the data source failed." + CR + ... "Error code: " + SQL.Error + CR + SQL.MesError) END // In any case (connection OK or not) SQLDisconnect()
Caution: The access to the databases in HiveQL is available at run time from Windows Vista or Windows Server 2008.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|