o
    i_                     @   sD   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 )    N)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
dB 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dB fd/d0Zde
fd1d2ZdededB 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   U/home/ubuntu/.local/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   uiWebUrl0   r   zSparkContext.uiWebUrlc                 C   r   r   r   r   r   r   r   version4   r   zSparkContext.versionc                 C   r   r   r   r   r   r   r   __repr__8      zSparkContext.__repr__pathc                 C   r   r   r   r   r&   r   r   r   
addArchive?   r%   zSparkContext.addArchiveF	recursivec                 C   r   r   r   )r   r&   r)   r   r   r   addFileB   r%   zSparkContext.addFilec                 C   r   r   r   r'   r   r   r   	addPyFileE   r%   zSparkContext.addPyFilec                 C   r   r   r   r   r   r   r   cancelAllJobsR   r%   zSparkContext.cancelAllJobsgroupIdc                 C   r   r   r   )r   r-   r   r   r   cancelJobGroupU   r%   zSparkContext.cancelJobGroupc                 C   r   r   r   r'   r   r   r   dump_profilesX   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   getConfa   r%   zSparkContext.getConfc                 C   r   r   r   )r   r   r   r   r   getLocalPropertyd   r%   zSparkContext.getLocalPropertydirNamec                 C   r   r   r   )r   r3   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-   r6   r7   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   intr   r    r!   r"   r#   r$   r(   boolr*   r+   r,   r.   r/   r0   r1   r2   r4   r5   r8   r9   r;   r<   r=   r   r   r   r   r      sL    

*
r   )r	   r   duckdb.experimental.spark.confr   #duckdb.experimental.spark.exceptionr   r   __all__r   r   r   r   <module>   s     
,