[
https://issues.apache.org/jira/browse/DRILL-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995562#comment-16995562
]
ASF GitHub Bot commented on DRILL-7486:
---------------------------------------
arina-ielchiieva commented on pull request #1928: DRILL-7486: Refactor row set
reader builders
URL: https://github.com/apache/drill/pull/1928#discussion_r357611175
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/resultSet/model/hyper/HyperReaderBuilder.java
##########
@@ -71,30 +72,26 @@
* the outer vector accessor.)
*/
-public abstract class BaseReaderBuilder extends AbstractReaderBuilder {
+public class HyperReaderBuilder extends ReaderBuilder {
- /**
- * Read-only row index into the hyper row set with batch and index
- * values mapping via an SV4.
- */
-
- public static class HyperRowIndex extends ReaderIndex {
+ private static final HyperReaderBuilder INSTANCE = new HyperReaderBuilder();
- private final SelectionVector4 sv4;
-
- public HyperRowIndex(SelectionVector4 sv4) {
- super(sv4.getCount());
- this.sv4 = sv4;
- }
+ private HyperReaderBuilder() { }
- @Override
- public int offset() {
- return AccessorUtilities.sv4Index(sv4.get(position));
- }
+ public static RowSetReaderImpl build(VectorContainer container,
TupleMetadata schema, SelectionVector4 sv4) {
+ HyperRowIndex rowIndex = new HyperRowIndex(sv4);
+ return new RowSetReaderImpl(schema, rowIndex,
+ INSTANCE.buildContainerChildren(container, schema));
+ }
- @Override
- public int hyperVectorIndex( ) {
- return AccessorUtilities.sv4Batch(sv4.get(position));
+ public static RowSetReaderImpl build(BatchAccessor batch) {
+ VectorContainer container = batch.container();
+ try {
+ return build(container,
+ new HyperSchemaInference().infer(container),
+ batch.selectionVector4());
+ } catch (SchemaChangeException e) {
+ throw new UnsupportedOperationException(e);
Review comment:
Why is we capture schema change exception, unsupported exception is thrown?
----------------------------------------------------------------
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:
[email protected]
> Restructure row set reader builder
> ----------------------------------
>
> Key: DRILL-7486
> URL: https://issues.apache.org/jira/browse/DRILL-7486
> Project: Apache Drill
> Issue Type: Improvement
> Reporter: Paul Rogers
> Assignee: Paul Rogers
> Priority: Minor
>
> The code to build a row set reader is located in several places, and is tied
> to theĀ {{RowSet}} class for historical reasons. This restructuring pulls out
> the code so it can be used from a {{VectorContainer}} or other source.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)