acrylJonny / dremio-sybase-connector

2 stars 7 forks source link

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

Closed davlee1972 closed 4 years ago

davlee1972 commented 4 years ago

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..

acrylJonny commented 4 years ago

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.

davlee1972 commented 4 years ago

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/

acrylJonny commented 4 years ago

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

acrylJonny commented 4 years ago

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