Databases Reference
In-Depth Information
0 : jdbc : lingual : local > SELECT * FROM EMPLOYEES . EMPLOYEES WHERE FIRST_NAME = 'Gina' ;
The result set should show records for a whole bunch of people named Gina.
An interesting use case for the Lingual SQL command shell is in organizations that use
Hadoop for large-scale data products, which are not using SQL already. For example,
consider the case where an Engineering team is building machine learning apps in
Cascalog…then Customer Support comes along with an interrupt task to pull the data
for a particular customer ID. Rather than derail Engineering with Support interrupts,
it makes sense to expose a view of the data through standard tools with ANSI SQL and
JDBC connections—these will already be familiar to the people working in Support,
Finance, Ops, etc.
Using the JDBC Driver
Connect to a directory on your computer where you have a few gigabytes of available
disk space, and then clone the source code repo from GitHub:
$ git clone git://github.com/Cascading/lingual.git
Once that completes, connect into the lingual directory, then into the lingual-local
subdirectory. Next build the Lingual JDBC connector to run locally:
$ gradle clean fatjar
Then connect into the ../lingual-examples subdirectory and take a look at the src/main/
java/cascading/lingual/examples/foodmart/JdbcExample.java app. Java source used to
execute SQL queries through a Lingual JDBC connection is much the same as with any
other JDBC driver:
import java.sql.Connection ;
import java.sql.DriverManager ;
import java.sql.ResultSet ;
import java.sql.SQLException ;
import java.sql.Statement ;
public class JdbcExample
{
public static void main ( String [] args ) throws Exception
{
new JdbcExample (). run ();
}
public void run () throws ClassNotFoundException , SQLException
{
Class . forName ( "cascading.lingual.jdbc.Driver" );
Connection connection = DriverManager . getConnection (
"jdbc:lingual:local;schemas=src/main/resources/data/example" );
Statement statement = connection . createStatement ();
ResultSet resultSet = statement . executeQuery (
Search WWH ::




Custom Search