o
    'i                     @   sP   d dl mZ d dlZd dlmZ d dlmZ d dlmZ G dd dZdgZ	dS )    )OptionalN)DuckDBPyConnection)	SparkConfContributionsAcceptedErrorc                	   @   s
  e Zd ZdeddfddZedefddZdGdd	Ze	dHd
e
e dd fddZe	dededdfddZedefddZedefddZedefddZedefddZedefddZedefddZdefddZdeddfd d!ZdIded#eddfd$d%Zdeddfd&d'ZdGd(d)Zd*eddfd+d,Zdeddfd-d.Zde
e fd/d0Zdefd1d2Zdede
e fd3d4Zd5eddfd6d7Z deddfd8d9Z!dId*ed:ed;eddfd<d=Z"dededdfd>d?Z#d@eddfdAdBZ$dGdCdDZ%defdEdFZ&dS )JSparkContextmasterreturnNc                 C   s   t d| _| jd d S )Nz:memory:z8set default_null_order='nulls_first_on_asc_last_on_desc')duckdbconnect_connectionexecute)selfr    r   _/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/duckdb/experimental/spark/context.py__init__
   s   zSparkContext.__init__c                 C   s   | j S N)r   r   r   r   r   
connection   s   zSparkContext.connectionc                 C   s   | j   d S r   )r   closer   r   r   r   stop   s   zSparkContext.stopconfc                 C      t r   r   )clsr   r   r   r   getOrCreate      zSparkContext.getOrCreatekeyvaluec                 C   r   r   r   )r   r   r   r   r   r   setSystemProperty   r   zSparkContext.setSystemPropertyc                 C   r   r   r   r   r   r   r   applicationId   r   zSparkContext.applicationIdc                 C   r   r   r   r   r   r   r   defaultMinPartitions"   r   z!SparkContext.defaultMinPartitionsc                 C   r   r   r   r   r   r   r   defaultParallelism&   r   zSparkContext.defaultParallelismc                 C   r   r   r   r   r   r   r   	startTime.   r   zSparkContext.startTimec                 C   r   r   r   r   r   r   r   uiWebUrl2   r   zSparkContext.uiWebUrlc                 C   r   r   r   r   r   r   r   version6   r   zSparkContext.versionc                 C   r   r   r   r   r   r   r   __repr__:      zSparkContext.__repr__pathc                 C   r   r   r   r   r'   r   r   r   
addArchiveA   r&   zSparkContext.addArchiveF	recursivec                 C   r   r   r   )r   r'   r*   r   r   r   addFileD   r&   zSparkContext.addFilec                 C   r   r   r   r(   r   r   r   	addPyFileG   r&   zSparkContext.addPyFilec                 C   r   r   r   r   r   r   r   cancelAllJobsT   r&   zSparkContext.cancelAllJobsgroupIdc                 C   r   r   r   )r   r.   r   r   r   cancelJobGroupW   r&   zSparkContext.cancelJobGroupc                 C   r   r   r   r(   r   r   r   dump_profilesZ   r&   zSparkContext.dump_profilesc                 C   r   r   r   r   r   r   r   getCheckpointDir`   r&   zSparkContext.getCheckpointDirc                 C   r   r   r   r   r   r   r   getConfc   r&   zSparkContext.getConfc                 C   r   r   r   )r   r   r   r   r   getLocalPropertyf   r&   zSparkContext.getLocalPropertydirNamec                 C   r   r   r   )r   r4   r   r   r   setCheckpointDir   r&   zSparkContext.setCheckpointDirc                 C   r   r   r   )r   r   r   r   r   setJobDescription   r&   zSparkContext.setJobDescriptiondescriptioninterruptOnCancelc                 C   r   r   r   )r   r.   r7   r8   r   r   r   setJobGroup   r&   zSparkContext.setJobGroupc                 C   r   r   r   )r   r   r   r   r   r   setLocalProperty   r&   zSparkContext.setLocalPropertylogLevelc                 C   r   r   r   )r   r;   r   r   r   setLogLevel   r&   zSparkContext.setLogLevelc                 C   r   r   r   r   r   r   r   show_profiles   r&   zSparkContext.show_profilesc                 C   r   r   r   r   r   r   r   	sparkUser   r&   zSparkContext.sparkUser)r	   Nr   )F)'__name__
__module____qualname__strr   propertyr   r   r   classmethodr   r   r   r   r   intr    r!   r"   r#   r$   r%   r)   boolr+   r,   r-   r/   r0   r1   r2   r3   r5   r6   r9   r:   r<   r=   r>   r   r   r   r   r   	   sL    

*
r   )
typingr   r
   r   duckdb.experimental.spark.confr   #duckdb.experimental.spark.exceptionr   r   __all__r   r   r   r   <module>   s     
,