kyoty edited a comment on pull request #5651:
URL: https://github.com/apache/dolphinscheduler/pull/5651#issuecomment-871369251
Sorry for the delay. I resubmit it, In order to satisfy CheckStyle's check,
the code has been formatted a lot and may be emm difficult to read....
- **Why the owner field can't worked as expected?**
- In pr: #4442, a new filed owner was introduced to display who owns the
resource. In my opinion, the implementation in the pr is incorrect. The join
query in the db sql can get the correct username, but in the ResourceMapper,
the Resource class is used to construct the data returned by the db query.
Please note that the Resource class does not have a userName field, which
results in that the userName can't be actually thereturned to front end.
I simulated the modification of this pr in my environment, which
confirms what I said above
- in pr: #4947 This pr is mainly to solve some obvious slow query
problems, but the join query about username does not feel like a bottleneck.
The join query was completely removed, which resulted in the username can't be
seen in the sql.
- **My Solution**
I try to solve this is to add a `userName` in `Resource`, and add a
annotation `@TableField(exist = false)`
Operations like `listPaging` and `update` all require a username field.
**I didn't introduce a wrapper class like DTO to solve this problem because I'm
worried that it would make the code look too complicated to maintain.**
@CalvinKirs @ruanwenjun any good idea? I'm not sure if I'm on the right
path.
--
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]