antonmks / Alenka

GPU database engine
Other
1.17k stars 120 forks source link

How can I use LEFT in multi-table JOIN? #29

Closed AlexeyAB closed 11 years ago

AlexeyAB commented 11 years ago

Hi Anton! If I use LEFT in a single-table JOIN then it works. But if I use LEFT in multi-table JOIN (non-star join), then I get an error: syntax error SQL scan parse failed

How can I use LEFT in multi-table JOIN?

Best regards, Alexey

antonmks commented 11 years ago

Fixed. Notice that you now need to download https://github.com/NVlabs/moderngpu Take a look at change.log to see what is new.

AlexeyAB commented 11 years ago

Hi Anton! Yes, it's work.

But if in q7.sql I use LEFT for JOIN, an example as:

LJ := SELECT l_suppkey AS l_suppkey, price AS price, discount AS discount, shipdate AS shipdate,
 n_name AS n_name
   FROM LF LEFT JOIN O ON l_orderkey = o_orderkey
           JOIN C ON o_custkey = c_custkey
           JOIN NF ON c_nationkey = n_nationkey;

Or:

LJ := SELECT l_suppkey AS l_suppkey, price AS price, discount AS discount, shipdate AS shipdate,
 n_name AS n_name
   FROM LF JOIN O ON l_orderkey = o_orderkey
           LEFT JOIN C ON o_custkey = c_custkey
           JOIN NF ON c_nationkey = n_nationkey;

Or:

LJ := SELECT l_suppkey AS l_suppkey, price AS price, discount AS discount, shipdate AS shipdate,
 n_name AS     n_name
   FROM LF JOIN O ON l_orderkey = o_orderkey
           JOIN C ON o_custkey = c_custkey
           LEFT JOIN NF ON c_nationkey = n_nationkey;

Then I get an exception.

antonmks commented 11 years ago

Fixed !