acrylJonny / dremio-sybase-connector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing DBO in SQL Statements when joins or where conditions addded.

davlee1972 opened this issue · comments

I’m not sure if this is a problem with the Community Plug-In or with the ARP.

A normal SQL statement for Sybase would look something like:

select a.key, a.column_a, b.column_b
from mydb.dbo.my_table1 a
join mydb.dbo.my_table2 b on b.key = a.key

Dremio should be converting this internally to:

select mydb.dbo.my_table1.key, mydb.dbo.my_table1.column_a, mydb.dbo.my_table2.column_b
from mydb.dbo.my_table1
join mydb.dbo.my_table2 on mydb.dbo.my_table2.key = mydb.dbo.my_table1.key

However in the logs I'm seeing:

select mydb.my_table1.key, mydb.my_table1.column_a, mydb.my_table2.column_b
from mydb.dbo.my_table1
join mydb.dbo.my_table2 on mydb.my_table2.key = mydb.my_table1.key

"dbo" is missing from the columns and where conditions..

This is actively being looked at. This will need a SybaseDialect to be specified which is currently being investigated. The same applies for Sybase not supporting LIMIT and instead using TOP.

Sybase syntax is more or less the same as Microsoft syntax since MS SQL Server was originally a Windows port of Sybase Unix.

TOP support in MS:

http://www.sqlservertutorial.net/sql-server-basics/sql-server-select-top/

For the time being I have disabled the join pushdown so that at least there will be no errors.

This has now been resolved by the inclusion of the SybaseDialect.java within the connector