You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Sanjiv Kumar <kt...@gmail.com> on 2016/04/04 09:07:31 UTC
Regarding Join Query Problem
I want to join two table using same storage plugin. But One Of the Column
showing null value. I am using this query:-
SELECT T2.ID AS T_ID,T1.ID AS T1_ID ,T1.ProviderID AS ProviderID,
T1.Name AS Name, T2.Code AS Code
FROM SqlServer.StuentDetails.P21.Class1 AS T1
right outer JOIN SqlServer.StuentDetails.P21.Class2
AS T2 ON T1.ProviderID = T2.ID
Here SqlServer is Storage Plugin Name, StuentDetails is Database Name, P21 is
a Schema Name, Class1, Class2 are Table Names.
While executing this query T_ID showing Null.
But If I am using two different storage plugin name with same credential it
works properly.
*Is it possible to join two table using same storage plugin name? If
yes,then What am I doing wrong in this query?*
Re: Regarding Join Query Problem
Posted by Magnus Pierre <mp...@maprtech.com>.
Hello Sanjiv,
It is perfectly valid to have two tables from the same plugin in a SQL statement in Drill.
Not really sure you are doing something wrong. RIGHT or LEFT joins allow for returning null on the left / right side if the join condition is not met. If you only would like to have records that are fulfilling the join condition use INNER JOIN.
If you know that you should get data back:
Can it be a case sensitive database and that you don’t have the appropriate case on a column somewhere?
Regards,
Magnus
---------------
Magnus Pierre | Systems Engineer
+46 72 710 1935
mpierre@maprtech.com | http://www.mapr.com
> 4 apr 2016 kl. 09:07 skrev Sanjiv Kumar <kt...@gmail.com>:
>
> I want to join two table using same storage plugin. But One Of the Column
> showing null value. I am using this query:-
>
> SELECT T2.ID AS T_ID,T1.ID AS T1_ID ,T1.ProviderID AS ProviderID,
> T1.Name AS Name, T2.Code AS Code
> FROM SqlServer.StuentDetails.P21.Class1 AS T1
> right outer JOIN SqlServer.StuentDetails.P21.Class2
> AS T2 ON T1.ProviderID = T2.ID
>
> Here SqlServer is Storage Plugin Name, StuentDetails is Database Name, P21 is
> a Schema Name, Class1, Class2 are Table Names.
>
> While executing this query T_ID showing Null.
>
> But If I am using two different storage plugin name with same credential it
> works properly.
>
> *Is it possible to join two table using same storage plugin name? If
> yes,then What am I doing wrong in this query?*