61yao commented on PR #9895: URL: https://github.com/apache/pinot/pull/9895#issuecomment-1336281494
> This works pretty well except one corner case: Select * From tbl1 LEFT join tbl2 order by 1; This column reference 1 is referring to different thing after rewrite. H2 actually has the same issue I guess they are also doing this rewrite trick. I tested it in psql and it works correctly (i.e. it returns the value in right order). We have a couple options: 1) Rewrite the order by 1 as well to handle the corner case. (this is kinda tricky because have to know how many rows for left and right table during sql rewrite 2) Re-order the columns after join. we somehow need to pass an option to join implementation to let join know the re-ordering is happening. 3) We just ignore the error and write in the documentation for the behavior expectation. 4) Write the implementation for right join Maybe let's do 4) for now and we can do the rewrite in next iteration? I do prefer the rewrite version if it works correctly because it is way more elegant than implementing everything twice. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org