o
    ˳ix                     @   sn  d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZm	Z	 d dl
mZ d dlmZ d dlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZ  d dlm!Z" d d	l#m$Z$m%Z%m&Z&m'Z' d d
l(m)Z) d dl*m+Z+m,Z, d dl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5 d dl6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z? d dl@mAZAmBZB d dlCmDZDmEZEmFZF d dlGmHZH d dlImJZJmKZKm!Z!mLZL d dlMmNZNmOZO d dlPmQZQmRZR d dlSmTZTmUZUmVZV d dlWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjmkZk d dllmmZmmnZn erd dloZpdZqdZrdZsdZtdZudZvdZwdZxdZydZzd Z{d!Z|d"Z}d#Z~d$Zd%ZeeZG d&d' d'ZdHd(eDd)edB d*ed+efd,d-Zd.Zd/Zd0Zd1ZeLjeLjiZ	dId0ed1edB d2eVdB d+eeef fd3d4Zd5e d6eVd+e fd7d8ZeYd9e_d:ead;e^d<e\d=eZd>eid?egd@ehdAeed?ekd?eXdBe]dBejdCiZG dDdE dEeEe ZG dFdG dGe4ZdS )J    N)TracebackType)TYPE_CHECKINGAnyUnion)urlparse)Client)AlreadyExistsExceptionCheckLockRequestEnvironmentContextFieldSchemaInvalidOperationExceptionLockComponent	LockLevelLockRequestLockResponse	LockStateLockTypeMetaExceptionNoSuchObjectException	SerDeInfoStorageDescriptorUnlockRequest)Database)Table)retryretry_if_exception_typestop_after_attemptwait_exponential)TBinaryProtocol)TSocket
TTransport)EXTERNAL_TABLEICEBERGLOCATIONMETADATA_LOCATION
TABLE_TYPEURIMetastoreCatalogPropertiesUpdateSummary)	CommitFailedExceptionNamespaceAlreadyExistsErrorNamespaceNotEmptyErrorNoSuchIcebergTableErrorNoSuchNamespaceErrorNoSuchPropertyExceptionNoSuchTableErrorTableAlreadyExistsErrorWaitingForLockException)UNPARTITIONED_PARTITION_SPECPartitionSpec)SchemaSchemaVisitorvisit)FromInputFile)CommitTableResponseStagedTabler   TableProperties)UNSORTED_SORT_ORDER	SortOrder)TableRequirementTableUpdate)
EMPTY_DICT
Identifier
Properties)
BinaryTypeBooleanTypeDateTypeDecimalType
DoubleType	FixedType	FloatTypeIntegerTypeListTypeLongTypeMapTypeNestedFieldPrimitiveType
StringType
StructTypeTimestampTypeTimestamptzTypeTimeTypeUnknownTypeUUIDType)property_as_boolproperty_as_floatcommentownerzhive.hive2-compatibleFzhive.kerberos-authenticationzhive.kerberos-service-namehivezlock-check-min-wait-timezlock-check-max-wait-timezlock-check-retriesg?<      DO_NOT_UPDATE_STATStruec                
   @   s   e Zd ZU dZeed< ee dB ed< dee	fdededB de
dB dedB fd	d
ZdefddZdefddZdefddZdee dB dedB dedB ddfddZdS )_HiveClientz4Helper class to nicely open and close the transport.
_transportN_ugiuriugikerberos_authkerberos_service_namec                 C   s4   || _ || _|| _|r|dnd | _|  | _d S N:)_uri_kerberos_auth_kerberos_service_namesplitra   _init_thrift_transportr`   )selfrb   rc   rd   re    rn   J/home/ubuntu/.local/lib/python3.10/site-packages/pyiceberg/catalog/hive.py__init__   s
   z_HiveClient.__init__returnc                 C   s>   t | j}t|j|j}| jst|S tj||j| j	dS )N)hostservice)
r   rh   r   hostnameportri   r    TBufferedTransportTSaslClientTransportrj   )rm   	url_partssocketrn   rn   ro   rl      s
   

z"_HiveClient._init_thrift_transportc                 C   s*   t  | j}t|}| jr|j| j  |S N)r   r`   r   ra   set_ugi)rm   protocolclientrn   rn   ro   _client   s
   z_HiveClient._clientc                 C   s|   | j  s:z
| j   W | 	 S  ttjfy9   z| j   W n	 ty)   Y nw |  | _ | j   Y | 	 S w | 	 S )z0Make sure the transport is initialized and open.)
r`   isOpenopen	TypeErrorr    TTransportExceptionclose	Exceptionrl   r~   )rm   rn   rn   ro   	__enter__   s   


	z_HiveClient.__enter__exctypeexcinstexctbc                 C   s   | j  r| j   dS dS )z!Close transport if it was opened.N)r`   r   r   )rm   r   r   r   rn   rn   ro   __exit__   s   
z_HiveClient.__exit__)__name__
__module____qualname____doc__r    __annotations__liststrHIVE_KERBEROS_AUTH_DEFAULTHIVE_KERBEROS_SERVICE_NAMEboolrp   rl   r   r~   r   typeBaseExceptionr   r   rn   rn   rn   ro   r_      s(   
 
.r_   schemalocationhive2_compatiblerq   c                    s,   t dd}t fdd| jD |dd|dS )Nz2org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe)serializationLibc                    s(   g | ]}t |jt|jt |jqS rn   )r   namer6   
field_typeSchemaToHiveConverterdoc).0fieldr   rn   ro   
<listcomp>   s    z6_construct_hive_storage_descriptor.<locals>.<listcomp>z(org.apache.hadoop.mapred.FileInputFormatz)org.apache.hadoop.mapred.FileOutputFormat)	serdeInfo)r   r   fields)r   r   r   ser_de_inforn   r   ro   "_construct_hive_storage_descriptor   s   

r   EXTERNAL
table_typemetadata_locationprevious_metadata_locationmetadata_propertiesc                 C   sJ   t dtdt| i}|r||t< |r#| D ]\}}||vr"t|||< q|S )NTRUEr"   )PROP_EXTERNALPROP_TABLE_TYPEPROP_METADATA_LOCATIONPROP_PREVIOUS_METADATA_LOCATIONitemsr   )r   r   r   
propertieskeyvaluern   rn   ro   _construct_parameters   s   r   databaser   c                 C   sH   i }|  D ]\}}|tkr|| _q|tkr|| _q|||< q|| _| S rz   )r   COMMENTdescriptionr#   locationUri
parameters)r   r   paramsr   r   rn   rn   ro   _annotate_namespace   s   
r   booleanintbigintfloatdoubledatestring	timestampztimestamp with local time zonebinaryvoidc                   @   s   e Zd ZU eed< defddZdededefddZd	e	d
e
e defddZdededefddZdededefddZ
dedededefddZdedefddZdS )r   r   c                 C   s
   || _ d S rz   r   )rm   r   rn   rn   ro   rp     s   
zSchemaToHiveConverter.__init__r   struct_resultrq   c                 C   s   |S rz   rn   )rm   r   r   rn   rn   ro   r        zSchemaToHiveConverter.schemastructfield_resultsc                 C   s   dd | dS )Nzstruct<,>)join)rm   r   r   rn   rn   ro   r     s   zSchemaToHiveConverter.structr   field_resultc                 C   s   |j  d| S rf   r   )rm   r   r   rn   rn   ro   r     s   zSchemaToHiveConverter.field	list_typeelement_resultc                 C   s   d| dS )Nzarray<r   rn   )rm   r   r   rn   rn   ro   r     s   zSchemaToHiveConverter.listmap_type
key_resultvalue_resultc                 C   s   d| d| dS )Nzmap<r   r   rn   )rm   r   r   r   rn   rn   ro   map  s   zSchemaToHiveConverter.map	primitivec                 C   s@   t |trd|j d|j dS | jrt |trdS tt| S )Nzdecimal(r   )r   )
isinstancerE   	precisionscaler   rR   HIVE_PRIMITIVE_TYPESr   )rm   r   rn   rn   ro   r     s
   
zSchemaToHiveConverter.primitiveN)r   r   r   r   r   rp   r4   r   r   rP   r   r   rM   r   rJ   rL   r   rN   r   rn   rn   rn   ro   r   	  s   
 r   c                       s  e Zd ZU eed< dedef fddZedeeef defddZ	d	e
defd
dZd	ede
fddZdede
ddfddZdededede
fddZdeeefdeeB deedf dedB dedededefddZdeeB dedefd d!Zd"eeB dee fd#d$ZdeeB defd%d&Zdedede fd'd(Z!deded)e"dede#f
d*d+Z$d	ed,e%e&d-f d.e%e'd-f de(fd/d0Z)deeB defd1d2Z*deeB ddfd3d4Z+deeB ddfd5d6Z,d7eeB d8eeB defd9d:Z-efd"eeB deddfd;d<Z.d"eeB ddfd=d>Z/d"eeB dee fd?d@Z0dMd"eeB dee fdBdCZ1d"eeB defdDdEZ2defd"eeB dFe3e dB d.ede4fdGdHZ5deeB ddfdIdJZ6dededefdKdLZ7  Z8S )NHiveCatalogr~   r   r   c                    sN   t  j|fi | | || _t|tt| _t|tt	| _
t|tt| _d S rz   )superrp   _create_hive_clientr~   rW   LOCK_CHECK_MIN_WAIT_TIME DEFAULT_LOCK_CHECK_MIN_WAIT_TIME_lock_check_min_wait_timeLOCK_CHECK_MAX_WAIT_TIME DEFAULT_LOCK_CHECK_MAX_WAIT_TIME_lock_check_max_wait_timeLOCK_CHECK_RETRIESDEFAULT_LOCK_CHECK_RETRIES_lock_check_retries)rm   r   r   	__class__rn   ro   rp   ,  s   
zHiveCatalog.__init__rq   c                 C   s   d }| t  dD ]+}zt|| dt| tt| ttW   S  t	y4 } z|}W Y d }~q	d }~ww |d ur;|t
d| t   )Nr   rc   z%Unable to connect to hive using uri: )r&   rk   r_   getrV   HIVE_KERBEROS_AUTHr   r   "HIVE_KERBEROS_SERVICE_NAME_DEFAULTr   
ValueError)r   last_exceptionrb   ern   rn   ro   r   8  s    


zHiveCatalog._create_hive_clienttablec           	   	   C   s   |j }t|vrtd|j d|j |t }| tkr/td| dt d|j d|j |t	 }r9|}ntdt	 d| j
|d}||}t|}t|j|jf||| 
|j|| d	S )
Nz7Property table_type missing, could not determine type: .zProperty table_type is z, expected z: zTable property z is missingr   
identifiermetadatar   iocatalog)r   r%   r.   dbName	tableNamelowerr"   r,   r   r$   _load_file_io	new_inputr7   table_metadatar   r   )	rm   r   r   r   prop_metadata_locationr   r   filer   rn   rn   ro   _convert_hive_into_icebergJ  s.   


z&HiveCatalog._convert_hive_into_icebergc                 C   s   |  }| |t\}}tt d }t|||jr$t|jv r$|jt nt	 |d |d t
| | t| jtttt|j|jddS )Ni  )r   r   )r   r   rY   
createTimelastAccessTimesd	tableTyper   )r    identifier_to_database_and_tabler/   r   time	HiveTabler   OWNERgetpassgetuserr   r   r   rV   HIVE2_COMPATIBLEHIVE2_COMPATIBLE_DEFAULTr!   r   r   )rm   r   identifier_tupledatabase_name
table_namecurrent_time_millisrn   rn   ro   _convert_iceberg_into_hiveg  s"    z&HiveCatalog._convert_iceberg_into_hiveopen_client
hive_tableNc              
   C   sF   z| | W d S  ty" } ztd|j d|j d|d }~ww )NzTable r    already exists)create_tabler   r0   r   r   )rm   r  r  r   rn   rn   ro   _create_hive_table{  s   zHiveCatalog._create_hive_tabler  r  c              
   C   s:   z|j ||dW S  ty } ztd| |d }~ww )Ndbnametbl_nameTable does not exists: )	get_tabler   r/   )rm   r  r  r  r   rn   rn   ro   _get_hive_table  s   zHiveCatalog._get_hive_tabler   r   z	pa.Schemar   partition_spec
sort_orderc                 C   s   i t |}| j||||||d}| |\}}	| |j|j|j | |}
| j}| 	||
 |j
||	d}W d   n1 sBw   Y  | |S )aA  Create a table.

        Args:
            identifier: Table identifier.
            schema: Table's schema.
            location: Location for the table. Optional Argument.
            partition_spec: PartitionSpec for the table.
            sort_order: SortOrder for the table.
            properties: Table properties that can be a string based dictionary.

        Returns:
            Table: the created table instance.

        Raises:
            AlreadyExistsError: If a table with the name already exists.
            ValueError: If the identifier is invalid.
        )r   r   r   r  r  r   r  N)DEFAULT_PROPERTIES_create_staged_tabler  _write_metadatar   r   r   r  r~   r  r  r   )rm   r   r   r   r  r  r   staged_tabler  r  tblr  r  rn   rn   ro   r    s"   

zHiveCatalog.create_tabler   c                 C   s   |  |\}}| j|d}||}t||ft|||| d}| |}| j}	| |	| |	j	||d}
W d   n1 s@w   Y  | 
|
S )ai  Register a new table using existing metadata.

        Args:
            identifier (Union[str, Identifier]): Table identifier for the table
            metadata_location (str): The location to the metadata

        Returns:
            Table: The newly registered table

        Raises:
            TableAlreadyExistsError: If the table already exists
        r   r   r  N)r  r   r   r9   r7   r   r  r~   r  r  r   )rm   r   r   r  r  r   metadata_filer!  r"  r  r  rn   rn   ro   register_table  s    


zHiveCatalog.register_table	namespacec                 C      t rz   NotImplementedError)rm   r%  rn   rn   ro   
list_views  r   zHiveCatalog.list_viewsc                 C   r&  rz   r'  rm   r   rn   rn   ro   view_exists  r   zHiveCatalog.view_existsc                 C   s2   t tjtj||dd}t|gt t	 d}|S )NT)levelr   r  	tablenameisTransactional)	componentuserrt   )
r   r   TABLEr   	EXCLUSIVEr   r  r	  ry   gethostname)rm   r  r  lock_componentlock_requestrn   rn   ro   _create_lock_request  s
   z HiveCatalog._create_lock_requestlockidc                    sF   t tttd| j| jdt| jdddtf fdd}| S )N   )
multiplierminmaxT)r   waitstopreraiserq   c                     sj    td} | jtjkr| S | jtjkr'd  d }t| t|t	d  d d| j )Nr7  zWait on lock for r   zFailed to check lock for 	, state: )

check_lockr	   stater   ACQUIREDWAITINGloggerwarningr1   r)   )responsemsgr  r7  r  r  rn   ro   _do_wait_for_lock  s   
z5HiveCatalog._wait_for_lock.<locals>._do_wait_for_lock)	r   r   r1   r   r   r   r   r   r   )rm   r  r  r7  r  rJ  rn   rI  ro   _wait_for_lock  s   zHiveCatalog._wait_for_lockrequirements.updatesc                 C   s~  |  }| |t\}}| j}|| ||}zz|jtjkr>|jtj	kr3| 
|||j| ntd| d|j z| |||}	| |	}
W n tyY   d}	d}
Y nw | |
|||}|
r|j|
jkrt|
j|
jdW W |t|jd W  d   S | j|j|j|jd |	r|
rt|j|
j|jd}|
j |j  }t|	jpi }|D ]}||d q|| ||	_t| |  t!| jt"t#|	_$|j%|||	t&t't(idd	 n| )t*||f|j|j|j| d
}	| +||	 W n t,y } ztd| d|j |d}~ww W |t|jd n
|t|jd w W d   n	1 s2w   Y  t|j|jdS )a   Commit updates to a table.

        Args:
            table (Table): The table to be updated.
            requirements: (Tuple[TableRequirement, ...]): Table requirements.
            updates: (Tuple[TableUpdate, ...]): Table updates.

        Returns:
            CommitTableResponse: The updated metadata.

        Raises:
            NoSuchTableError: If a table with the given identifier does not exist.
            CommitFailedException: Requirement not met, or a conflict with a concurrent commit.
        zFailed to acquire lock for r@  N)r   r   r?  )r   r   metadata_path)r   r   r   r   r  r  new_tblenvironment_contextr   )-r   r  r/   r~   lockr6  rB  r   rC  rD  rK  r7  r)   r  r   _update_and_stage_tabler   r8   r   unlockr   r   r   r   r   keysdictr   popupdater   r   r   rV   r
  r  r  $alter_table_with_environment_contextr
   r]   DO_NOT_UPDATE_STATS_DEFAULTr  r9   r  r1   )rm   r   rL  rM  table_identifierr  r  r  rS  r  current_tableupdated_staged_tablenew_iceberg_propertiesdeleted_iceberg_propertiesexisting_hms_parametersr   r   rn   rn   ro   commit_table  s   
?
	*WzHiveCatalog.commit_tablec                 C   sN   |  |t\}}| j}| |||}W d   n1 sw   Y  | |S )a  Load the table's metadata and return the table instance.

        You can also use this method to check for table existence using 'try catalog.table() except TableNotFoundError'.
        Note: This method doesn't scan data stored in the table.

        Args:
            identifier: Table identifier.

        Returns:
            Table: the table instance with its metadata.

        Raises:
            NoSuchTableError: If a table with the name does not exist, or the identifier is invalid.
        N)r  r/   r~   r  r   )rm   r   r  r  r  r  rn   rn   ro   
load_tablef  s
   
zHiveCatalog.load_tablec              
   C   sz   |  |t\}}z | j}|j||dd W d   W dS 1 s!w   Y  W dS  ty< } ztd| |d}~ww )zDrop a table.

        Args:
            identifier: Table identifier.

        Raises:
            NoSuchTableError: If a table with the name does not exist, or the identifier is invalid.
        F)r  r   
deleteDataNr  )r  r/   r~   
drop_tabler   )rm   r   r  r  r  r   rn   rn   ro   re  |  s   	&zHiveCatalog.drop_tablec                 C   s   t d)NzNot yet implementedr'  r*  rn   rn   ro   purge_table  s   zHiveCatalog.purge_tablefrom_identifierto_identifierc           
   
   C   s   |  |t\}}|  |\}}| |rtd| z0| j#}|j||d}||_||_|j|||t	t
tidd W d   n1 sEw   Y  W n' ty_ }	 ztd| |	d}	~	w tyr }	 ztd| |	d}	~	ww | |S )a2  Rename a fully classified table name.

        Args:
            from_identifier: Existing table identifier.
            to_identifier: New table identifier.

        Returns:
            Table: the updated table instance with its metadata.

        Raises:
            ValueError: When from table identifier is invalid.
            NoSuchTableError: When a table with the name does not exist.
            NoSuchNamespaceError: When the destination namespace doesn't exist.
            TableAlreadyExistsError: When the destination table already exists.
        zTable already exists: r  rO  rP  NzTable does not exist: Database does not exists: )r  r/   table_existsr0   r~   r  r   r   rZ  r
   r]   r[  r   r   r-   rc  )
rm   rg  rh  from_database_namefrom_table_nameto_database_nameto_table_namer  r"  r   rn   rn   ro   rename_table  s2   


zHiveCatalog.rename_tablec              
   C   s   |  |}t||d}z | j}|t|| W d   W dS 1 s$w   Y  W dS  ty@ } z	td| d|d}~ww )aT  Create a namespace in the catalog.

        Args:
            namespace: Namespace identifier.
            properties: A string dictionary of properties for the given namespace.

        Raises:
            ValueError: If the identifier is invalid.
            AlreadyExistsError: If a namespace with the given name already exists.
        )r   r   N	Database r  )identifier_to_databaseHiveDatabaser~   create_databaser   r   r*   )rm   r%  r   r  hive_databaser  r   rn   rn   ro   create_namespace  s   
&zHiveCatalog.create_namespacec              
   C   s   |  |t}z | j}|j|ddd W d   W dS 1 sw   Y  W dS  ty; } z	td| d|d}~w tyN } ztd| |d}~ww )a  Drop a namespace.

        Args:
            namespace: Namespace identifier.

        Raises:
            NoSuchNamespaceError: If a namespace with the given name does not exist, or the identifier is invalid.
            NamespaceNotEmptyError: If the namespace is not empty.
        F)rd  cascadeNrp  z is not emptyri  )rq  r-   r~   drop_databaser   r+   r   )rm   r%  r  r  r   rn   rn   ro   drop_namespace  s   
&zHiveCatalog.drop_namespacec                    sZ   |  |t | j} fdd|j |j ddD W  d   S 1 s&w   Y  dS )a  List Iceberg tables under the given namespace in the catalog.

        When the database doesn't exist, it will just return an empty list.

        Args:
            namespace: Database to list.

        Returns:
            List[Identifier]: list of table identifiers.

        Raises:
            NoSuchNamespaceError: If a namespace with the given name does not exist, or the identifier is invalid.
        c                    s,   g | ]}|j td  tkr |jfqS ) )r   r   r%   r   r"   r   )r   r   r  rn   ro   r     s
    z+HiveCatalog.list_tables.<locals>.<listcomp>)db_name)r  	tbl_namesN)rq  r-   r~   get_table_objects_by_nameget_all_tablesrm   r%  r  rn   rz  ro   list_tables  s   
$zHiveCatalog.list_tablesrn   c                 C   sF   |rg S | j }tt| j| W  d   S 1 sw   Y  dS )zList namespaces from the given namespace. If not given, list top-level namespaces from the catalog.

        Returns:
            List[Identifier]: a List of namespace identifiers.
        N)r~   r   r   identifier_to_tupleget_all_databasesr  rn   rn   ro   list_namespaces  s
   $zHiveCatalog.list_namespacesc              
   C   s   |  |t}z0| j"}|j|d}|j}|j|t< |j }r"||t< |W  d   W S 1 s/w   Y  W dS  t	yJ } ztd| |d}~ww )a2  Get properties for a namespace.

        Args:
            namespace: Namespace identifier.

        Returns:
            Properties: Properties for the given namespace.

        Raises:
            NoSuchNamespaceError: If a namespace with the given name does not exist, or identifier is invalid.
        r   Nri  )
rq  r-   r~   get_databaser   r   r#   r   r   r   )rm   r%  r  r  r   r   rX   r   rn   rn   ro   load_namespace_properties  s   

(z%HiveCatalog.load_namespace_propertiesremovalsc                 C   s   | j ||d | |t}| j_}z
||}|j}W n ty/ } ztd| |d}~ww t }	t }
|rK|D ]}||v rJ|| |		| q:|r_|
 D ]\}}|||< |
	| qQ||t|| W d   n1 srw   Y  |p{t |	}tt|	pg t|
pg t|dS )a  Remove provided property keys and update properties for a namespace.

        Args:
            namespace: Namespace identifier.
            removals: Set of property keys that need to be removed. Optional Argument.
            updates: Properties to be updated for the given namespace.

        Raises:
            NoSuchNamespaceError: If a namespace with the given name does not exist
            ValueError: If removals and updates have overlapping keys.
        )rM  r  ri  N)removedupdatedmissing)_check_for_overlaprq  r-   r~   r  r   r   setrX  addr   alter_databaser   
differencer(   r   )rm   r%  r  rM  r  r  r   r   r   r  r  r   r   expected_to_changern   rn   ro   update_namespace_properties  s4   



"z'HiveCatalog.update_namespace_propertiesc                 C   r&  rz   r'  r*  rn   rn   ro   	drop_viewF  r   zHiveCatalog.drop_viewc                 C   s   |  ||S )zIOverride the default warehouse location to follow Hive-style conventions.)"_get_hive_style_warehouse_location)rm   r  r  rn   rn   ro   _get_default_warehouse_locationI  s   z+HiveCatalog._get_default_warehouse_location)rn   )9r   r   r   r_   r   r   rp   staticmethodrW  r   r  r   r   r  r   r  r  r2   r;   r?   r@   r   r4   r3   r<   rA   r  r$  r   r)  r   r+  r   r6  r   r   rK  tupler=   r>   r8   rb  rc  re  rf  ro  ru  rx  r  r  r  r  r(   r  r  r  __classcell__rn   rn   r   ro   r   )  s~   
 


.	


p'

*r   )F)NN)r  loggingry   r  typesr   typingr   r   r   urllib.parser   "hive_metastore.ThriftHiveMetastorer   hive_metastore.ttypesr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rr  r   r  tenacityr   r   r   r   thrift.protocolr   thrift.transportr   r    pyiceberg.catalogr!   r"   r#   r$   r%   r&   r'   r(   pyiceberg.exceptionsr)   r*   r+   r,   r-   r.   r/   r0   r1   pyiceberg.partitioningr2   r3   pyiceberg.schemar4   r5   r6   pyiceberg.serializersr7   pyiceberg.tabler8   r9   r:   pyiceberg.table.sortingr;   r<   pyiceberg.table.updater=   r>   pyiceberg.typedefr?   r@   rA   pyiceberg.typesrB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   pyiceberg.utils.propertiesrV   rW   pyarrowpar   r  r
  r  r   r   r   r   r   r   r   r   r   r   r]   r[  	getLoggerr   rE  r_   r   r   r   r   r   r   r   PARQUET_COMPRESSIONPARQUET_COMPRESSION_DEFAULTr  rW  r   r   r   r   r   rn   rn   rn   ro   <module>   s   H(,
X
 8

 