You are on page 1of 2

Setting up Mongo connection in ETL Validator using Drill

Step 1: Launch ETL Validator


Step 2: Create a new “Mongo through Drill” Connection.
 Name: Can be anything you want.
 User Name & Password: You can put null/null if there is no
username/password. This is a known issue and will be fixed in upcoming
versions.
 Connection Type: Leave it as Auto
 Host Name: You can provide localhost.
 Port: Leave the default port on which Drill must be running.
 Retrieve and select a schema from Mongo.

Step 3: Test the Connection.

Now, you are ready to execute Query Comparison or other test plans in ETL
Validator. Few sample queries are below. Depending on the complexity of the JSON
structure, you may need more time to understand how to get the right query.
 SELECT * from mongo.test.`addresses`;
 SELECT  ad.address.building FROM mongo.test.addresses as ad
 SELECT  ad.address.coord FROM mongo.test.addresses as ad
The above queries assume that the JSON is as follows and these documents are in
the mongo.test schema.
{“address”: {“building”: “1007”, “coord”: [-73.856077, 40.848447], “street”: “Morris
Park Ave”, “zipcode”: “10462”}, “borough”: “Bronx”, “cuisine”: “Bakery”, “grades”:
[{“date”: {“$date”: 1393804800000}, “grade”: “A”, “score”: 2}, {“date”: {“$date”:
1378857600000}, “grade”: “A”, “score”: 6}, {“date”: {“$date”: 1358985600000},
“grade”: “A”, “score”: 10}, {“date”: {“$date”: 1322006400000}, “grade”: “A”, “score”:
9}, {“date”: {“$date”: 1299715200000}, “grade”: “B”, “score”: 14}], “name”: “Morris
Park Bake Shop”, “restaurant_id”: “30075445”}
{“address”: {“building”: “469”, “coord”: [-73.961704, 40.662942], “street”: “Flatbush
Avenue”, “zipcode”: “11225”}, “borough”: “Brooklyn”, “cuisine”: “Hamburgers”,
“grades”: [{“date”: {“$date”: 1419897600000}, “grade”: “A”, “score”: 8}, {“date”:
{“$date”: 1404172800000}, “grade”: “B”, “score”: 23}, {“date”: {“$date”:
1367280000000}, “grade”: “A”, “score”: 12}, {“date”: {“$date”: 1336435200000},
“grade”: “A”, “score”: 12}], “name”: “Wendy’S”, “restaurant_id”: “30112340”}

For More: Apache Drill in ETL Validator


If you want to connect Testing tools click ETL Testing Tools, BI Testing Tools

You might also like