Jay
Jay

Reputation: 1

Apache Drill with mongoDB : Getting issue while joining two collection

As i am new in apache drill and mongodb need someone's help

I have to fetch data after joining two tables Table1 courierrecords Table2 customers

query:-

select courierrecords.shipmentReferenceNumber1, customers.name 
from courierrecords
join customers on courierrecords.customer_id=customers.customerId;

getting below error enter image description here

Table 1

Table2

Any help here. also any ideas how to join with ObjectId's

I have tried many examples which I find on internet as well as in Apache documentation but still getting errors

Upvotes: 0

Views: 168

Answers (1)

Dzamo Norton
Dzamo Norton

Reputation: 1389

You can refer to MongoDB ObjectIDs from Drill SQL using the column name _id, e.g.

select courierrecords.shipmentReferenceNumber1, customers.name 
from courierrecords join customers on courierrecords._id = customers._id;

Please also see DRILL-8190 which describes a recently fixed bug relating to MongoDB collection joins. Drill 1.20.3 was released a few hours ago and includes a fix for Drill-8190, so please test again using Drill 1.20.3.

Upvotes: 1

Related Questions