You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Jonathan Bayles <jb...@billtrust.com.INVALID> on 2019/04/26 20:28:14 UTC

Struggling with mssql schema names

when I try to join across two servers, where one is mssql, I have to lodge
myself into the mssql side with uses:

use dbserver.dbname;
use dbserver.schemaname;

select blah from mysqlserver.dbname.table a1 inner join tablename a2 on
a1.field = a2.field where...

Any time I try to reference the table name with context on the mssql server
the query blows up because of the schema name and no permutation seems to
work. Why is this happening and what can I do about it?

-- 
Jonathan Bayles

Re: Struggling with mssql schema names

Posted by Kunal Khatua <ku...@apache.org>.
Did you try using the accent quotes/back ticks (on the top left neighbouring the TAB key) to enclose the schema and table names? 

You might have to experiment with something like `ABC.PQR`.`XYZ` or `ABC`.`PQR.XYZ`.

This is how it is done for resolving paths across, so it shoudl work the same for this too:
https://drill.apache.org/docs/selecting-flat-data/ [https://drill.apache.org/docs/selecting-flat-data/]

On 4/26/2019 1:28:36 PM, Jonathan Bayles <jb...@billtrust.com.invalid> wrote:
when I try to join across two servers, where one is mssql, I have to lodge
myself into the mssql side with uses:

use dbserver.dbname;
use dbserver.schemaname;

select blah from mysqlserver.dbname.table a1 inner join tablename a2 on
a1.field = a2.field where...

Any time I try to reference the table name with context on the mssql server
the query blows up because of the schema name and no permutation seems to
work. Why is this happening and what can I do about it?

--
Jonathan Bayles