[ 
https://issues.apache.org/jira/browse/BEAM-8664?focusedWorklogId=350681&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-350681
 ]

ASF GitHub Bot logged work on BEAM-8664:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Nov/19 21:25
            Start Date: 27/Nov/19 21:25
    Worklog Time Spent: 10m 
      Work Description: 11moon11 commented on pull request #10095: [BEAM-8664] 
[SQL] MongoDb project push down
URL: https://github.com/apache/beam/pull/10095#discussion_r351503650
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/mongodb/MongoDbTable.java
 ##########
 @@ -84,13 +91,41 @@
     return readDocuments.apply(DocumentToRow.withSchema(getSchema()));
   }
 
+  @Override
+  public PCollection<Row> buildIOReader(
+      PBegin begin, BeamSqlTableFilter filters, List<String> fieldNames) {
+    MongoDbIO.Read readBuilder =
+        
MongoDbIO.read().withUri(dbUri).withDatabase(dbName).withCollection(dbCollection);
+
+    final FieldAccessDescriptor resolved =
+        FieldAccessDescriptor.withFieldNames(fieldNames)
+            .withOrderByFieldInsertionOrder()
+            .resolve(getSchema());
+    final Schema newSchema = SelectHelpers.getOutputSchema(getSchema(), 
resolved);
+
+    if (!(filters instanceof DefaultTableFilter)) {
+      throw new RuntimeException("Unimplemented at the moment.");
 
 Review comment:
   I agree that the error message could be clearer here, but a predicate 
push-down PR for MongoDB is in the works, so this exception won't be there for 
too long.
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 350681)
    Time Spent: 2h  (was: 1h 50m)

> [SQL] MongoDb should use project push-down
> ------------------------------------------
>
>                 Key: BEAM-8664
>                 URL: https://issues.apache.org/jira/browse/BEAM-8664
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Kirill Kozlov
>            Assignee: Kirill Kozlov
>            Priority: Major
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> MongoDbTable should implement the following methods:
> {code:java}
> public PCollection<Row> buildIOReader(
>     PBegin begin, BeamSqlTableFilter filters, List<String> fieldNames);
> public ProjectSupport supportsProjects();
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to