rjurney commented on a change in pull request #15: Add Spark functionality to 
DataFu, datafu-spark
URL: https://github.com/apache/datafu/pull/15#discussion_r287923515
 
 

 ##########
 File path: datafu-spark/src/main/scala/datafu/spark/DataFrameOps.scala
 ##########
 @@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package datafu.spark
+
+import org.apache.spark.sql.{Column, DataFrame}
+
+object DataFrameOps {
 
 Review comment:
   @eyala @uzadude @matthayes Yes, I thought this was the point of the entire 
thing. Why not have an `activate()` function and then add these methods to the 
`DataFrame` class? pymongo_spark does this to add methods like 
`pyspark.sql.DataFrame.saveToMongoDB` which make the API consistent with 
PySpark's.
   
   See: 
https://github.com/mongodb/mongo-hadoop/tree/master/spark/src/main/python#usage
   
   ```python
   import pymongo_spark
   pymongo_spark.activate()
   
   ...
   
   some_rdd.saveToMongoDB('mongodb://localhost:27017/db.output_collection')
   ```

----------------------------------------------------------------
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


With regards,
Apache Git Services

Reply via email to