fastflowtransform.table_formats.spark_default¶
DefaultSparkFormatHandler ¶
Bases: SparkFormatHandler
Default Spark format handler for non-Delta managed tables (e.g. Parquet, ORC, generic catalog tables).
Responsibilities
- save_df_as_table() using DataFrameWriter.saveAsTable.
- incremental_insert() uses the base implementation (INSERT INTO ...).
- incremental_merge() is intentionally NOT implemented and is expected to be handled by the executor via a generic fallback.
Source code in src/fastflowtransform/table_formats/spark_default.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
save_df_as_table ¶
save_df_as_table(table_name, df)
Save DataFrame as a managed table using Spark's built-in formats.
- Overwrites the table content.
- Uses self.table_format (if provided) as the writer format.
- Applies self.table_options as writer options.
Source code in src/fastflowtransform/table_formats/spark_default.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
run_sql ¶
run_sql(sql)
Execute SQL via the injected runner (guardable in the executor).
Source code in src/fastflowtransform/table_formats/base.py
45 46 47 | |
qualify_identifier ¶
qualify_identifier(table_name, *, database=None)
Return the physical table identifier for Spark APIs (unquoted).
Source code in src/fastflowtransform/table_formats/base.py
50 51 52 | |
format_identifier_for_sql ¶
format_identifier_for_sql(table_name, *, database=None)
Return a SQL-safe identifier (per-part quoted) for the table.
Source code in src/fastflowtransform/table_formats/base.py
54 55 56 57 58 59 60 | |
allows_unmanaged_paths ¶
allows_unmanaged_paths()
Whether storage.path overrides should be honored for this format.
Source code in src/fastflowtransform/table_formats/base.py
69 70 71 | |
incremental_insert ¶
incremental_insert(table_name, select_body_sql)
Default incremental INSERT implementation, format-agnostic.
select_body_sql must be a SELECT-able body (no trailing semicolon),
e.g. "SELECT ... FROM ...".
Source code in src/fastflowtransform/table_formats/base.py
97 98 99 100 101 102 103 104 105 106 107 108 | |
incremental_merge ¶
incremental_merge(table_name, select_body_sql, unique_key)
Optional: incremental MERGE semantics (UPSERT-like). Subclasses may override this. Default: not supported.
Engines using this handler MUST be prepared to handle NotImplementedError and fall back to a more generic strategy.
Source code in src/fastflowtransform/table_formats/base.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |