
    p                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r  SSK	Jr   " S	 S
\R                  5      rg)zBase class for the Presto job.    )absolute_import)division)unicode_literals)encoding)arg_parsers)base)utilc                   H    \ rS rSrSr\S 5       r\S 5       r\S 5       rSr	g)
PrestoBase   z!Submit a Presto job to a cluster.c           
         U R                  SS9nUR                  SSSSS/ SS	9  UR                  S
SSS9  U R                  S[        R                  " 5       SSS9  U R                  S[        R
                  S9  U R                  S[        R                  " 5       SSS9  U R                  SSSS9  U R                  SSS9  U R                  S[        R                  " 5       SSS9  g) zAParses command line arguments specific to submitting Presto jobs.T)requiredz	--executez-eQUERYqueriesappendzA Presto query to execute.)metavardestactiondefaulthelpz--filez-fz9HCFS URI of file containing the Presto script to execute.)r   z--propertieszPARAM=VALUEz;A list of key value pairs to set Presto session properties.)typer   r   z--properties-filez--driver-log-levelszPACKAGE=LEVELzpA list of package-to-log4j log level pairs to configure driver logging. For example: root=FATAL,com.example=INFOz--continue-on-failure
store_truez%Whether to continue if a query fails.)r   r   z--query-output-formatz[The query output display format. See the Presto documentation for supported output formats.z--client-tags
CLIENT_TAGz5A list of Presto client tags to attach to this query.N)add_mutually_exclusive_groupadd_argumentr   ArgDictjob_utilPROPERTIES_FILE_HELP_TEXTArgList)parserdrivers     6lib/googlecloudsdk/command_lib/dataproc/jobs/presto.pyArgsPrestoBase.Args   s>    00$0?F
)  + H  J   "J	  L
 //  1   "B	  D 4  6 .  0   "D	  F    c                     SU R                   0$ )Nfile)r'   )argss    r"   GetFilesByTypePrestoBase.GetFilesByTypeK   s    DIIr%   c                    U R                  UR                  US   US9nUR                  (       a  U R                  UR                  S9Ul        UR
                  (       a  UR
                  Ul        UR                  (       a  UR                  Ul        [        R                  " UR                  UR                  5      nU(       a.  [        R                  " X`R                   R                  SS9Ul        XQl        g)z0Populates the prestoJob member of the given job.r'   )continueOnFailurequeryFileUriloggingConfig)r   T)
sort_itemsN)	PrestoJobcontinue_on_failurer   	QueryList	queryListquery_output_formatoutputFormatclient_tags
clientTagsr   BuildJobProperties
propertiesproperties_filer   DictToAdditionalPropertyMessagePropertiesValue	prestoJob)messagesjobfiles_by_typelogging_configr(   
presto_jobjob_propertiess          r"   ConfigureJobPrestoBase.ConfigureJobO   s     ##22"6*$ $ &J
 ||%///Ej $ 8 8j"..j00--/N&FF
,,<<Oj Mr%    N)
__name__
__module____qualname____firstlineno____doc__staticmethodr#   r)   rD   __static_attributes__rF   r%   r"   r   r      sB    ))F )FV    r%   r   N)rK   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.callioper   (googlecloudsdk.command_lib.dataproc.jobsr   job_baser	   r   JobBaser   rF   r%   r"   <module>rT      s3    % &  ' % / E EJ!! Jr%   