Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 1.63 KB

File metadata and controls

64 lines (46 loc) · 1.63 KB

Spark SQL Client

Level Technologies Target Product Product Versions Source

Beginners

Teiid, JDBC, Spark SQL

DV

DV 6.1

https://github.com/teiid/teiid-quickstarts

What is it?

Spark SQL can read data from other databases using JDBC. The Spark SQL Client demonstrates how to use Spark SQL to read data from VDB.

The program expects four arguments . The pom.xml defines these arguments in the pom.xml:

<mainClass>SparkSQLClient</mainClass>
<arguments>
    <argument>localhost</argument>  <!-- host -->
    <argument>31000</argument>   <!--  port -->
    <argument>${vdb}</argument>
    <argument>${table}</argument> <!-- table or view defined in VDB -->
</arguments>
Note
Notice that the and are preset. To point to a different server and/or port, change "localhost" and/or "31000" arguments, respectively, in the pom.xml.

Prerequisites

Build

Build the project by running

mvn clean install

Execution

To execute a sql query using the simpleclient, use the following format:

mvn exec:java -Dvdb="<vdb>" -Dtable="<table>" -Dusername="<username>" -Dpassword="<password>"
A Example Executions
mvn exec:java -Dvdb="twitter" -Dtable="tweet"
mvn exec:java -Dvdb="Portfolio" -Dtable="product"
mvn exec:java -Dvdb="ExcelVDB" -Dtable="PersonalHoldings"