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

hvanhovell 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 6165b12c7a64 [SPARK-49249][SPARK-49122][SQL] CONNECT] Add missing doc 
for the `addArtifact` API
6165b12c7a64 is described below

commit 6165b12c7a64b4d1206696054e9bbcc15d72f8bf
Author: Paddy Xu <[email protected]>
AuthorDate: Tue Sep 3 19:23:08 2024 -0400

    [SPARK-49249][SPARK-49122][SQL] CONNECT] Add missing doc for the 
`addArtifact` API
    
    ### What changes were proposed in this pull request?
    
    This PR is a follow-up of https://github.com/apache/spark/pull/47631 which 
adds a docstring to the `addArtifact` API. The doc was missing from the 
previous PR.
    
    ### Why are the changes needed?
    
    The previous PR missed a docstring.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Not needed.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #47974 from xupefei/add-artifact-doc.
    
    Authored-by: Paddy Xu <[email protected]>
    Signed-off-by: Herman van Hovell <[email protected]>
---
 .../scala/org/apache/spark/sql/api/SparkSession.scala  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/sql/api/src/main/scala/org/apache/spark/sql/api/SparkSession.scala 
b/sql/api/src/main/scala/org/apache/spark/sql/api/SparkSession.scala
index d156aba934b6..0c173d9da498 100644
--- a/sql/api/src/main/scala/org/apache/spark/sql/api/SparkSession.scala
+++ b/sql/api/src/main/scala/org/apache/spark/sql/api/SparkSession.scala
@@ -333,6 +333,24 @@ abstract class SparkSession[DS[U] <: Dataset[U, DS]] 
extends Serializable with C
   @Experimental
   def addArtifact(uri: URI): Unit
 
+  /**
+   * Add a single in-memory artifact to the session while preserving the 
directory structure
+   * specified by `target` under the session's working directory of that 
particular file
+   * extension.
+   *
+   * Supported target file extensions are .jar and .class.
+   *
+   * ==Example==
+   * {{{
+   *  addArtifact(bytesBar, "foo/bar.class")
+   *  addArtifact(bytesFlat, "flat.class")
+   *  // Directory structure of the session's working directory for class 
files would look like:
+   *  // ${WORKING_DIR_FOR_CLASS_FILES}/flat.class
+   *  // ${WORKING_DIR_FOR_CLASS_FILES}/foo/bar.class
+   * }}}
+   *
+   * @since 4.0.0
+   */
   @Experimental
   def addArtifact(bytes: Array[Byte], target: String): Unit
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to