[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SQL] Cross Join Operation

Hi everyone,

To prove the idea of GSoC project, I was working on some simple TPC-DS queries running with given generated data on direct runner. query example

The example is executed with TPC-DS query 9. Briefly, Query 9 uses case when clauses to select 5 counting numbers from store_sales (table 1). In order to show those result numbers, case when clause inside one select clause. In short, it looks like:
CASE WHEN ( SELECT count(*)  FROM  table 1 WHERE..... )
THEN condition 1
ELSE condition 2,
FROM table 2

IIUC, this query doesn't need join operation on table 1 and table 2 since outside select clause doesn't need to interfere with table 1. 
But, the program shows it does and throws errors message said "java.lang.UnsupportedOperationException: CROSS JOIN is not supported". (error message detail)

To make the query work, I am wondering where I can start with:
1. see logic plan?
Will logic plan explain why the query need CROSS JOIN? 

2. cross join support? 
I checked all queries in TPC-DS benchmark. Almost every query uses cross join. It is an important feature needs to implement. Unlike other join, it consumes a lot of computing resource. But, I think we need cross join in the future. and support both in join-library? I noticed James has open BEAM-2194 for supporting cross join.

Looking forward to comments!