read_catalog_table
ReadCatalogTableAction
¶
Bases: PipelineAction
Reads a table from Unity Catalog using a specified table identifier and optional reader configurations.
This function retrieves data from a catalog table using the
CatalogReader identified
by either the table_identifier parameter or the table_metadata from the
provided PipelineContext of a previous step. The retrieved data is loaded
into a DataFrame and returned as part of an updated PipelineContext.
Example
Read Sales Table:
action: READ_CATALOG_TABLE
options:
table_identifier: my_catalog.business_schema.sales_table
options: <options for the CatalogReader read method>
delta_load_options:
strategy: CDF
delta_load_identifier: my_delta_load_id
strategy_options:
deduplication_columns: ["id"]
enable_full_load: true
Read Sales Table:
action: READ_CATALOG_TABLE
options:
table_identifier: my_catalog.business_schema.sales_table
options: <options for the CatalogReader read method>
delta_load_options:
strategy: CDF
delta_load_identifier: my_delta_load_id
strategy_options:
deduplication_columns: ["id"]
enable_full_load: true
Source code in src/cloe_nessy/pipeline/actions/read_catalog_table.py
10 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 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 | |
run(context, *, table_identifier=None, options=None, delta_load_options=None, stream=False, **_)
¶
Reads a table from Unity Catalog using a specified table identifier and optional reader configurations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
PipelineContext
|
The pipeline's context, which contains metadata and configuration for the action. |
required |
table_identifier
|
str | None
|
The identifier of the catalog table to
read. If not provided, the function will attempt to use the table
identifier from the |
None
|
options
|
dict[str, str] | None
|
A dictionary of options for customizing
the |
None
|
delta_load_options
|
dict[Any, Any] | DeltaLoadOptions | None
|
Options for delta loading, if applicable.
Configures the |
None
|
stream
|
bool
|
If True, the action will read the table as a stream. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither |
Returns: An updated pipeline context containing the data read from the catalog table as a DataFrame.
Source code in src/cloe_nessy/pipeline/actions/read_catalog_table.py
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 | |