Mapdjdbc commands


#1

i was using sqlimporter in java
t customertest -su root -sp login123 -c "jdbc:postgresql://thickset-dev-postgres.cu9mypqoftvu.us-east-1.rds.amazonaws.com/mavpack" -ss "select * from supply_chain.\"customer\"" -p HyperInteractive -s "jdbc:mapd:localhost:9092:mapd"

the above is command but i am getting error as java.net.UnknownHostException: jdbc:mapd:localhost:9092:mapd


#2

Hi @nagulan,

Since port 9091 is the default port for client connections using jdbc, odbc etc., so that may be the problem. As you are using all the default settings ie localhost, db=mapd, u=mapd & pw=HyperInteractive, you don’t need to specify explicitly. Here is the example from the documentation:

PostgreSQL Example:

java -cp /path/to/mapd/bin/mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:/path/to/postgresql-9.4.1208.jre6.jar com.mapd.utility.SQLImporter -t mapd_target_table -su source_user -sp source_pwd -c “jdbc:postgresql://server/database” -ss "select * from some_table where transaction_date > ‘2014-01-01’ "

Regards,
Veda


#3

how to give explicitly some other mapd server in above command

is there any way to migrate a table from one mapd server to another can you give some example command for this


#4

Hi @nagulan,

Into -s parameter you have (if you need) to specify the Mapd server name, not the Mapd’s connect string; so in your case would be -s localhost.

If you are loading locally with the default username, password, and database, you can omit the parameter.

To import the table name flights into a table named flight_ora from Oracle to a local mapd

java -cp mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:OJDBC-Full/ojdbc7.jar com.mapd.utility.SQLImporter -t flights_ora -su u_cdc_sirtel_sna_ese -sp Password -c “jdbc:oracle:thin:@10.38.11.71:1521:dwcdcde” -ss “select * from flights”

To import the table name flights into a table named flight_ora from Oracle to a remote server mapd

java -cp mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:OJDBC-Full/ojdbc7.jar com.mapd.utility.SQLImporter -t flights_ora -su u_cdc_sirtel_sna_ese -sp Password -c “jdbc:oracle:thin:@10.38.11.71:1521:dwcdcde” -ss “select * from flights” -s REMOTE_MAPD_SERVER


#5

i have tried with above commands but i dont how to move a table from one mapd server to another mapd server

i want to move from host server to another mapd host
i tried but its giving me error as java.sql.SQLException: No suitable driver found for p


#6

here the example; the remote host is located on 192.168.1.10 with commuting as a database name and is being imported on a local mapd instance with default parameters.

java -cp mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:mapd-1.0-SNAPSHOT-jar-with-dependencies.jar com.mapd.utility.SQLImporter -c "jdbc:mapd:192.168.1.10:9091:commuting" -t matrix_temp4_test -su mapd -sp HyperInteractive -ss "select * from matrix_temp4 limit 1000000000000"

I don’t know if it’s a viable option to transfer huge tables because you will need a massive chunk of memory to project all the columns of the source table.

p.s. you have to use a limit with a huge number because if you don’t the driver will do with a default value of 100000.