Github user jacques-n commented on a diff in the pull request:
https://github.com/apache/drill/pull/193#discussion_r41628774
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DirectPlan.java
---
@@ -45,11 +52,15 @@ public static PhysicalPlan
createDirectPlan(QueryContext context, boolean result
public static <T> PhysicalPlan createDirectPlan(QueryContext context, T
obj){
Iterator<T> iter = (Iterator<T>) Collections.singleton(obj).iterator();
return createDirectPlan(context.getCurrentEndpoint(), iter, (Class<T>)
obj.getClass());
+ }
+ public static <T> PhysicalPlan createDirectPlan(DrillbitEndpoint
endpoint, Iterator<T> iterator, Class<T> clazz) {
+ PojoRecordReader<T> reader = new PojoRecordReader<>(clazz, iterator);
+ return createDirectPlan(endpoint, reader, ScanStats.TRIVIAL_TABLE);
}
- public static <T> PhysicalPlan createDirectPlan(DrillbitEndpoint
endpoint, Iterator<T> iterator, Class<T> clazz){
- PojoRecordReader<T> reader = new PojoRecordReader<T>(clazz, iterator);
- DirectGroupScan scan = new DirectGroupScan(reader);
+
+ public static PhysicalPlan createDirectPlan(DrillbitEndpoint endpoint,
RecordReader reader, ScanStats stats) {
--- End diff --
Let's keep the default behavior static constructor (which uses trivial) and
then we don't have to update the constructor everywhere.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---