[
https://issues.apache.org/jira/browse/CALCITE-4884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17446742#comment-17446742
]
Julian Hyde commented on CALCITE-4884:
--------------------------------------
Hey [~Chunwei Lei], If you add a constructor without documentation or tests,
you're doing what I call a "drill a hole" change that benefits you but not the
project. There is a {{RelWriterTest}} and you should have extended it, without
any prompting from [~zabetak].
> Provide a new constructor for RelJsonWriter to allow customized JsonBuilder
> ---------------------------------------------------------------------------
>
> Key: CALCITE-4884
> URL: https://issues.apache.org/jira/browse/CALCITE-4884
> Project: Calcite
> Issue Type: Improvement
> Reporter: Chunwei Lei
> Assignee: Chunwei Lei
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.29.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Currently JsonBuilder in RelJsonWriter cannot be customized due to it being
> created in the constructor. We can provide a new constructor for
> RelJsonWriter to allow customized JsonBuilder.
> {code:java}
> // code placeholder
> public RelJsonWriter() {
> jsonBuilder = new JsonBuilder();
> relList = jsonBuilder.list();
> relJson = new RelJson(jsonBuilder);
> }
> // the new constrctor suggested.
> public RelJsonWriter(JsonBuilder jsonBuilder) {
> this.jsonBuilder = jsonBuilder;
> relList = jsonBuilder.list();
> relJson = new RelJson(jsonBuilder);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)