LiBinfeng-01 opened a new pull request, #22482: URL: https://github.com/apache/doris/pull/22482
## Proposed changes Problem: When create view with join in table partitions, an error would rise like "Unknown column" Example: CREATE VIEW my_view AS SELECT t1.* FROM t1 PARTITION(p1) JOIN t2 PARTITION(p2) ON t1.k1 = t2.k1; select * from my_view ==> errCode = 2, detailMessage = Unknown column 'k1' in 't2' Reason: When create view, we do tosql first in order to persistent view sql. And when doing tosql of table reference, partition key word was removed to keep neat of sql string. But here when we remove partition keyword it would regarded as an alias. So "PARTITION" keyword can not be removed. Solved: Add “PARTITION” keyword back to tosql string. ## Further comments If this is a relatively large or complex change, kick off the discussion at [[email protected]](mailto:[email protected]) by explaining why you chose the solution you did and what alternatives you considered, etc... -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
