[
https://issues.apache.org/jira/browse/DRILL-4728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15410172#comment-15410172
]
ASF GitHub Bot commented on DRILL-4728:
---------------------------------------
Github user vkorukanti commented on a diff in the pull request:
https://github.com/apache/drill/pull/527#discussion_r73767170
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/store/pojo/PojoRecordReader.java
---
@@ -47,24 +46,30 @@
import org.apache.drill.exec.vector.AllocationHelper;
import org.apache.drill.exec.vector.ValueVector;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
-public class PojoRecordReader<T> extends AbstractRecordReader {
+public class PojoRecordReader<T> extends AbstractRecordReader implements
Iterable<T> {
private static final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(PojoRecordReader.class);
private static final ControlsInjector injector =
ControlsInjectorFactory.getInjector(PojoRecordReader.class);
- public final int forJsonIgnore = 1;
-
private final Class<T> pojoClass;
- private final Iterator<T> iterator;
+ private final List<T> pojoObjects;
private PojoWriter[] writers;
private boolean doCurrent;
private T currentPojo;
private OperatorContext operatorContext;
+ private Iterator<T> currentIterator;
+
+ /**
+ * TODO: Cleanup the callers to pass the List of POJO objects directly
rather than iterator.
+ * @param pojoClass
+ * @param iterator
+ */
public PojoRecordReader(Class<T> pojoClass, Iterator<T> iterator) {
this.pojoClass = pojoClass;
- this.iterator = iterator;
+ this.pojoObjects = ImmutableList.copyOf(iterator);
--- End diff --
We already create a list and pass the iterator. So we are not losing any
lazyness. Are there any places where we populate when iterator is accessed?
> Add support for new metadata fetch APIs
> ---------------------------------------
>
> Key: DRILL-4728
> URL: https://issues.apache.org/jira/browse/DRILL-4728
> Project: Apache Drill
> Issue Type: Sub-task
> Components: Metadata
> Reporter: Venki Korukanti
> Assignee: Venki Korukanti
> Fix For: 1.8.0
>
>
> Please see the doc attached to the parent JIRA DRILL-4714 for details on APIs.
> Add support for following APIs (including {{protobuf}} messages, server
> handling code and Java client APIs)
> {code}
> List<Catalog> getCatalogs(Filter catalogNameFilter)
> List<Schema> getSchemas(
> Filter catalogNameFilter,
> Filter schemaNameFilter
> )
> List<Table> getTables(
> Filter catalogNameFilter,
> Filter schemaNameFilter,
> Filter tableNameFilter
> )
> List<Column> getColumns(
> Filter catalogNameFilter,
> Filter schemaNameFilter,
> Filter tableNameFilter,
> Filter columnNameFilter
> )
> {code}
> Note: native client changes are not going to be included in this patch. Will
> file a separate JIRA.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)