Skip to content
Advertisement

Apache Phoenix SQL Join Limitation when using sub-queries

I have this query in Apache Phoenix SQL:

I get java language illegal ... blurb for this not overly complex statement. But I cannot see the reason here or in the manuals.

The individual queries work (imagine the ( and , are not there), but no joy when these 2 sub-queries merged to a JOIN.

Do I need to persist the results to tables and then JOIN? Or is there way around this? I have the impression this is too complex in terms of sub-queries.

Advertisement

Answer

For others to note, this is a big and a different SQL Approach is needed as per below which is a work-around with note from Cloudera:

The best workaround is to explicitly define a join in the APP2 query. See the APP_MAX_TIMESTAMP table joined with the APP table, defining basically the same condition as in the original query (but using a table join instead of an inner select):

The query that should work and should do the same as the original query:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement