This is an automated email from the ASF dual-hosted git repository.

ruifengz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a471cceebed [MINOR][TESTS] Add a helper function for `spark.table` in 
dsl
4a471cceebed is described below

commit 4a471cceebedd938f781eb385162d33058124092
Author: Ruifeng Zheng <ruife...@apache.org>
AuthorDate: Thu May 23 19:46:46 2024 +0800

    [MINOR][TESTS] Add a helper function for `spark.table` in dsl
    
    ### What changes were proposed in this pull request?
    Add a helper function for `spark.table` in dsl
    
    ### Why are the changes needed?
    to be used in tests
    
    ### Does this PR introduce _any_ user-facing change?
    no, test only
    
    ### How was this patch tested?
    ci
    
    ### Was this patch authored or co-authored using generative AI tooling?
    no
    
    Closes #46717 from zhengruifeng/dsl_read.
    
    Authored-by: Ruifeng Zheng <ruife...@apache.org>
    Signed-off-by: Ruifeng Zheng <ruife...@apache.org>
---
 .../scala/org/apache/spark/sql/connect/dsl/package.scala  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git 
a/connector/connect/server/src/test/scala/org/apache/spark/sql/connect/dsl/package.scala
 
b/connector/connect/server/src/test/scala/org/apache/spark/sql/connect/dsl/package.scala
index a94bbf9c8f24..3edb63ee8e81 100644
--- 
a/connector/connect/server/src/test/scala/org/apache/spark/sql/connect/dsl/package.scala
+++ 
b/connector/connect/server/src/test/scala/org/apache/spark/sql/connect/dsl/package.scala
@@ -332,6 +332,21 @@ package object dsl {
       def sql(sqlText: String): Relation = {
         
Relation.newBuilder().setSql(SQL.newBuilder().setQuery(sqlText)).build()
       }
+
+      def table(name: String): Relation = {
+        proto.Relation
+          .newBuilder()
+          .setRead(
+            proto.Read
+              .newBuilder()
+              .setNamedTable(
+                proto.Read.NamedTable
+                  .newBuilder()
+                  .setUnparsedIdentifier(name)
+                  .build())
+              .build())
+          .build()
+      }
     }
 
     implicit class DslNAFunctions(val logicalPlan: Relation) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to