fastflowtransform.executors¶
BigQueryBFExecutor ¶
Bases: BigQueryIdentifierMixin, BaseExecutor[DataFrame]
Source code in src/fastflowtransform/executors/bigquery_bf_exec.py
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |
run_sql ¶
run_sql(node, env)
Orchestrate SQL models
1) Render Jinja (ref/source/this) and strip leading {{ config(...) }}. 2) If the SQL is full DDL (CREATE …), execute it verbatim (passthrough). 3) Otherwise, normalize to CREATE OR REPLACE {TABLE|VIEW} AS
. The body is CTE-aware (keeps WITH … SELECT … intact).On failure, raise ModelExecutionError with a helpful snippet.
Source code in src/fastflowtransform/executors/base.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
on_node_built ¶
on_node_built(node, relation, fingerprint)
Mirror DuckDB/PG: write/update _ff_meta after successful build.
Source code in src/fastflowtransform/executors/bigquery_bf_exec.py
81 82 83 84 85 86 87 88 | |
exists_relation ¶
exists_relation(relation)
Check presence in TABLES or VIEWS information schema.
Source code in src/fastflowtransform/executors/bigquery_bf_exec.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
create_table_as ¶
create_table_as(relation, select_sql)
CTAS with cleaned SELECT body (no trailing semicolons).
Source code in src/fastflowtransform/executors/bigquery_bf_exec.py
217 218 219 220 221 222 223 224 225 | |
incremental_insert ¶
incremental_insert(relation, select_sql)
INSERT INTO with cleaned SELECT body.
Source code in src/fastflowtransform/executors/bigquery_bf_exec.py
227 228 229 230 231 232 233 234 235 | |
incremental_merge ¶
incremental_merge(relation, select_sql, unique_key)
Portable fallback in BigQuery (without full MERGE): - DELETE collisions via WHERE EXISTS against the cleaned SELECT body - INSERT all rows from the body Executed as two statements to keep error surfaces clean.
Source code in src/fastflowtransform/executors/bigquery_bf_exec.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
alter_table_sync_schema ¶
alter_table_sync_schema(relation, select_sql, *, mode='append_new_columns')
Best-effort additive schema sync
- infer select schema via dry-run (schema on QueryJob)
- add missing columns as NULLABLE with inferred type
Source code in src/fastflowtransform/executors/bigquery_bf_exec.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |
BigQueryExecutor ¶
Bases: BigQueryIdentifierMixin, BaseExecutor[DataFrame]
Source code in src/fastflowtransform/executors/bigquery_exec.py
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
ENGINE_NAME
class-attribute
instance-attribute
¶
ENGINE_NAME = 'bigquery'
BigQuery executor (pandas DataFrames). ENV/Profiles typically use: - FF_BQ_PROJECT - FF_BQ_DATASET - FF_BQ_LOCATION (optional)
run_sql ¶
run_sql(node, env)
Orchestrate SQL models
1) Render Jinja (ref/source/this) and strip leading {{ config(...) }}. 2) If the SQL is full DDL (CREATE …), execute it verbatim (passthrough). 3) Otherwise, normalize to CREATE OR REPLACE {TABLE|VIEW} AS
. The body is CTE-aware (keeps WITH … SELECT … intact).On failure, raise ModelExecutionError with a helpful snippet.
Source code in src/fastflowtransform/executors/base.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
on_node_built ¶
on_node_built(node, relation, fingerprint)
Write/update dataset._ff_meta after a successful build.
Source code in src/fastflowtransform/executors/bigquery_exec.py
146 147 148 149 150 151 152 153 154 | |
exists_relation ¶
exists_relation(relation)
Check presence in INFORMATION_SCHEMA for tables/views.
Source code in src/fastflowtransform/executors/bigquery_exec.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
create_table_as ¶
create_table_as(relation, select_sql)
CREATE TABLE AS with cleaned SELECT body (no trailing semicolons).
Source code in src/fastflowtransform/executors/bigquery_exec.py
183 184 185 186 187 188 189 190 191 192 193 | |
incremental_insert ¶
incremental_insert(relation, select_sql)
INSERT INTO with cleaned SELECT body.
Source code in src/fastflowtransform/executors/bigquery_exec.py
195 196 197 198 199 200 201 202 203 204 205 | |
incremental_merge ¶
incremental_merge(relation, select_sql, unique_key)
Portable fallback without native MERGE
- DELETE collisions via WHERE EXISTS against the cleaned SELECT body
- INSERT new rows from the same body
Source code in src/fastflowtransform/executors/bigquery_exec.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
alter_table_sync_schema ¶
alter_table_sync_schema(relation, select_sql, *, mode='append_new_columns')
Best-effort additive schema sync
- infer select schema via LIMIT 0 query
- add missing columns as NULLABLE using inferred BigQuery types
Source code in src/fastflowtransform/executors/bigquery_exec.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
DatabricksSparkExecutor ¶
Bases: BaseExecutor[DataFrame]
Source code in src/fastflowtransform/executors/databricks_spark_exec.py
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 | |
ENGINE_NAME
class-attribute
instance-attribute
¶
ENGINE_NAME = 'databricks_spark'
Spark/Databricks executor without pandas: Python models operate on Spark DataFrames.
run_sql ¶
run_sql(node, env)
Orchestrate SQL models
1) Render Jinja (ref/source/this) and strip leading {{ config(...) }}. 2) If the SQL is full DDL (CREATE …), execute it verbatim (passthrough). 3) Otherwise, normalize to CREATE OR REPLACE {TABLE|VIEW} AS
. The body is CTE-aware (keeps WITH … SELECT … intact).On failure, raise ModelExecutionError with a helpful snippet.
Source code in src/fastflowtransform/executors/base.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
on_node_built ¶
on_node_built(node, relation, fingerprint)
After successful materialization, upsert _ff_meta (best-effort).
Source code in src/fastflowtransform/executors/databricks_spark_exec.py
350 351 352 353 354 355 356 | |
exists_relation ¶
exists_relation(relation)
Check whether a table/view exists (optionally qualified with database).
Source code in src/fastflowtransform/executors/databricks_spark_exec.py
359 360 361 362 363 364 | |
create_table_as ¶
create_table_as(relation, select_sql)
CREATE TABLE AS with cleaned SELECT body.
Source code in src/fastflowtransform/executors/databricks_spark_exec.py
366 367 368 369 370 | |
incremental_insert ¶
incremental_insert(relation, select_sql)
INSERT INTO with cleaned SELECT body.
Source code in src/fastflowtransform/executors/databricks_spark_exec.py
372 373 374 375 | |
incremental_merge ¶
incremental_merge(relation, select_sql, unique_key)
Try Delta MERGE (Databricks typical). If MERGE fails (non-Delta), fallback to full replace.
Source code in src/fastflowtransform/executors/databricks_spark_exec.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 | |
alter_table_sync_schema ¶
alter_table_sync_schema(relation, select_sql, *, mode='append_new_columns')
Best-effort additive schema sync
- infer select schema via LIMIT 0
- add missing columns as STRING (safe default)
Source code in src/fastflowtransform/executors/databricks_spark_exec.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 | |
DuckExecutor ¶
Bases: BaseExecutor[DataFrame]
Source code in src/fastflowtransform/executors/duckdb_exec.py
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
run_sql ¶
run_sql(node, env)
Orchestrate SQL models
1) Render Jinja (ref/source/this) and strip leading {{ config(...) }}. 2) If the SQL is full DDL (CREATE …), execute it verbatim (passthrough). 3) Otherwise, normalize to CREATE OR REPLACE {TABLE|VIEW} AS
. The body is CTE-aware (keeps WITH … SELECT … intact).On failure, raise ModelExecutionError with a helpful snippet.
Source code in src/fastflowtransform/executors/base.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
clone ¶
clone()
Generates a new Executor instance with own connection for Thread-Worker.
Source code in src/fastflowtransform/executors/duckdb_exec.py
32 33 34 35 36 | |
on_node_built ¶
on_node_built(node, relation, fingerprint)
After successful materialization, ensure the meta table exists and upsert the row.
Source code in src/fastflowtransform/executors/duckdb_exec.py
122 123 124 125 126 127 128 129 130 131 | |
incremental_merge ¶
incremental_merge(relation, select_sql, unique_key)
Fallback strategy for DuckDB: - DELETE collisions via DELETE ... USING (
Source code in src/fastflowtransform/executors/duckdb_exec.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
alter_table_sync_schema ¶
alter_table_sync_schema(relation, select_sql, *, mode='append_new_columns')
Best-effort: add new columns with inferred type.
Source code in src/fastflowtransform/executors/duckdb_exec.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
PostgresExecutor ¶
Bases: BaseExecutor[DataFrame]
Source code in src/fastflowtransform/executors/postgres_exec.py
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
run_sql ¶
run_sql(node, env)
Orchestrate SQL models
1) Render Jinja (ref/source/this) and strip leading {{ config(...) }}. 2) If the SQL is full DDL (CREATE …), execute it verbatim (passthrough). 3) Otherwise, normalize to CREATE OR REPLACE {TABLE|VIEW} AS
. The body is CTE-aware (keeps WITH … SELECT … intact).On failure, raise ModelExecutionError with a helpful snippet.
Source code in src/fastflowtransform/executors/base.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
on_node_built ¶
on_node_built(node, relation, fingerprint)
Write/update _ff_meta in the current schema after a successful build.
Source code in src/fastflowtransform/executors/postgres_exec.py
164 165 166 167 168 169 170 171 172 | |
exists_relation ¶
exists_relation(relation)
Return True if a table OR view exists for 'relation' in current schema.
Source code in src/fastflowtransform/executors/postgres_exec.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
incremental_merge ¶
incremental_merge(relation, select_sql, unique_key)
Portable fallback: staging + delete + insert.
Source code in src/fastflowtransform/executors/postgres_exec.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
alter_table_sync_schema ¶
alter_table_sync_schema(relation, select_sql, *, mode='append_new_columns')
Add new columns present in SELECT but missing on target (as text).
Source code in src/fastflowtransform/executors/postgres_exec.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
SnowflakeSnowparkExecutor ¶
Bases: BaseExecutor[DataFrame]
Source code in src/fastflowtransform/executors/snowflake_snowpark_exec.py
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
ENGINE_NAME
class-attribute
instance-attribute
¶
ENGINE_NAME = 'snowflake_snowpark'
Snowflake executor operating on Snowpark DataFrames (no pandas).
run_sql ¶
run_sql(node, env)
Orchestrate SQL models
1) Render Jinja (ref/source/this) and strip leading {{ config(...) }}. 2) If the SQL is full DDL (CREATE …), execute it verbatim (passthrough). 3) Otherwise, normalize to CREATE OR REPLACE {TABLE|VIEW} AS
. The body is CTE-aware (keeps WITH … SELECT … intact).On failure, raise ModelExecutionError with a helpful snippet.
Source code in src/fastflowtransform/executors/base.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
on_node_built ¶
on_node_built(node, relation, fingerprint)
After successful materialization, upsert _ff_meta (best-effort).
Source code in src/fastflowtransform/executors/snowflake_snowpark_exec.py
128 129 130 131 132 133 134 | |
exists_relation ¶
exists_relation(relation)
Check existence via information_schema.tables.
Source code in src/fastflowtransform/executors/snowflake_snowpark_exec.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
incremental_merge ¶
incremental_merge(relation, select_sql, unique_key)
Portable fallback without explicit column list
- WITH src AS ()
- DELETE ... USING src ...
- INSERT ... SELECT * FROM src
This avoids Snowflake MERGE column listing complexity.
Source code in src/fastflowtransform/executors/snowflake_snowpark_exec.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
alter_table_sync_schema ¶
alter_table_sync_schema(relation, select_sql, *, mode='append_new_columns')
Best-effort additive schema sync
- infer SELECT schema via LIMIT 0
- add missing columns as STRING
Source code in src/fastflowtransform/executors/snowflake_snowpark_exec.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |