[ https://issues.apache.org/jira/browse/DRILL-7350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16908947#comment-16908947 ]
ASF GitHub Bot commented on DRILL-7350: --------------------------------------- vvysotskyi commented on pull request #1843: DRILL-7350: Move RowSet related classes from test folder URL: https://github.com/apache/drill/pull/1843#discussion_r314448553 ########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/physical/rowSet/RowSetWriterImpl.java ########## @@ -129,7 +129,7 @@ public RowSetWriter addRow(Object...values) { @Override public RowSetWriter addSingleCol(Object value) { - return addRow(new Object[] {value}); + return addRow(value); Review comment: I made this change because IDE proposed it but after some investigation, I still think that it will work as it is expected. Java determines whether to treat the incoming argument as a single element or as an array for vararg functions at the compilation stage. So for the following case code will work as you have described - the vararg will be a one-dimensional array of strings: ``` addRow(new String[]{"a", "b"}); ``` But the following case will have different behavior - vararg will be treated as a two-dimensional array: ``` Object s = new String[]{"a", "a"}; addRow(s); ``` So code here will work as it is expected. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Move RowSet related classes from test folder > -------------------------------------------- > > Key: DRILL-7350 > URL: https://issues.apache.org/jira/browse/DRILL-7350 > Project: Apache Drill > Issue Type: Task > Reporter: Volodymyr Vysotskyi > Assignee: Volodymyr Vysotskyi > Priority: Major > Fix For: 1.17.0 > > > Move RowSet related classes from test folder to main to be able to use them > for Metastore. -- This message was sent by Atlassian JIRA (v7.6.14#76016)