@@ -250,6 +250,7 @@ class Compression(Enum):
250250 DEFLATE = "DEFLATE"
251251 RAW_DEFLATE = "RAW_DEFLATE"
252252 XZ = "XZ"
253+ SNAPPY = "SNAPPY"
253254
254255
255256class CopyFormat (ClauseElement ):
@@ -401,6 +402,30 @@ def __init__(
401402class ParquetFormat (CopyFormat ):
402403 format_type = "PARQUET"
403404
405+ def __init__ (
406+ self ,
407+ * ,
408+ missing_field_as : str = None ,
409+ compression : Compression = None ,
410+ ):
411+ super ().__init__ ()
412+ if missing_field_as :
413+ if missing_field_as not in ["ERROR" , "FIELD_DEFAULT" ]:
414+ raise TypeError (
415+ 'Missing Field As should be "ERROR" or "FIELD_DEFAULT".'
416+ )
417+ self .options ["MISSING_FIELD_AS" ] = f"{ missing_field_as } "
418+ if compression :
419+ if compression not in [Compression .ZSTD , Compression .SNAPPY ]:
420+ raise TypeError (
421+ 'Compression should be None, ZStd, or Snappy.'
422+ )
423+ self .options ["COMPRESSION" ] = compression .value
424+
425+
426+ class AVROFormat (CopyFormat ):
427+ format_type = "AVRO"
428+
404429 def __init__ (
405430 self ,
406431 * ,
@@ -418,6 +443,19 @@ def __init__(
418443class ORCFormat (CopyFormat ):
419444 format_type = "ORC"
420445
446+ def __init__ (
447+ self ,
448+ * ,
449+ missing_field_as : str = None ,
450+ ):
451+ super ().__init__ ()
452+ if missing_field_as :
453+ if missing_field_as not in ["ERROR" , "FIELD_DEFAULT" ]:
454+ raise TypeError (
455+ 'Missing Field As should be "ERROR" or "FIELD_DEFAULT".'
456+ )
457+ self .options ["MISSING_FIELD_AS" ] = f"{ missing_field_as } "
458+
421459
422460class StageClause (ClauseElement , FromClauseRole ):
423461 """Stage Clause"""
0 commit comments