You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "grundprinzip (via GitHub)" <gi...@apache.org> on 2023/06/07 08:29:04 UTC
[GitHub] [spark-connect-go] grundprinzip commented on a diff in pull request #10: [SPARK-43351] Add DataFrame writer and reader prototype code
grundprinzip commented on code in PR #10:
URL: https://github.com/apache/spark-connect-go/pull/10#discussion_r1221138909
##########
client/sql/dataframereader.go:
##########
@@ -0,0 +1,41 @@
+package sql
+
+import proto "github.com/apache/spark-connect-go/v_3_4/internal/generated"
+
+type DataFrameReader interface {
Review Comment:
Same for doc here and below for the methods.
##########
client/sql/dataframe.go:
##########
@@ -31,6 +31,7 @@ type DataFrame interface {
Show(numRows int, truncate bool) error
Schema() (*StructType, error)
Collect() ([]Row, error)
+ Write() DataFrameWriter
}
type dataFrameImpl struct {
Review Comment:
I'm wondering if we should split the interfaces and the impls across multiple files for readability?
##########
client/sql/dataframereader.go:
##########
@@ -0,0 +1,41 @@
+package sql
+
+import proto "github.com/apache/spark-connect-go/v_3_4/internal/generated"
+
+type DataFrameReader interface {
+ Format(source string) DataFrameReader
+ Load(path string) (DataFrame, error)
Review Comment:
I think it's fine to create incremental PRs for the new features, but it would be great to leave a comment here showing which methods are missing in the interface.
##########
client/sql/dataframe.go:
##########
@@ -31,6 +31,7 @@ type DataFrame interface {
Show(numRows int, truncate bool) error
Schema() (*StructType, error)
Collect() ([]Row, error)
+ Write() DataFrameWriter
Review Comment:
My suggestion is to add the basic documentation (even though it's replicated from OSS Spark)
##########
client/sql/sparksession.go:
##########
@@ -154,3 +163,17 @@ func (s *sparkSessionImpl) analyzePlan(plan *proto.Plan) (*proto.AnalyzePlanResp
}
return response, nil
}
+
+func consumeExecutePlanClient(responseClient proto.SparkConnectService_ExecutePlanClient) error {
Review Comment:
Can you add a bit doc on how the data is consumed and how it deals with streaming results etc.
##########
client/sql/dataframewriter.go:
##########
@@ -0,0 +1,79 @@
+package sql
+
+import (
+ "fmt"
+ proto "github.com/apache/spark-connect-go/v_3_4/internal/generated"
+ "strings"
+)
+
+type DataFrameWriter interface {
Review Comment:
Doc :) Same comment on the missing methods for incremental changes.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org