OracleSource
class OracleSource(
uri: str,
query: str | List[str],
credentials: UserPasswordCredentials | None = None,
initial_values: dict | None = None,
)
Bases: SourcePlugin
Categories: source
Oracle-based data inputs.
Initializes the OracleSource with the given URI and query, and optionally connection credentials and initial values for the parameters in the SQL queries.
Parameters
uriThe URI of the database where the data is located
queryThe SQL query(s) to execute. If multiple queries are provided, they must be provided as a list, and they will be mapped to the function inputs in the same order as they are defined.
credentialsThe credentials required to access the Oracle database. Must be a UserPasswordCredentials object.
initial_valuesThe initial values for the parameters in the SQL queries.
Raises
InputConfigurationError
Properties
credentialsUserPasswordCredentials | NoneThe credentials required to access Oracle. If no credentials were provided, it will return None.
initial_valuesdictThe initial values for the parameters in the SQL queries.
querystr | List[str]The SQL query(s) to execute.
uristrThe URI of the database where the data is located.
Methods
chunkdef chunk(working_dir: str) -> list[str]
Trigger the import of the data. This must be implemented in any class that inherits from this class unless directly implementing streaming. The method will receive a folder where it must store the data as parquet files, and return a list of the paths of the files created. This files will then be loaded and mapped to the dataset function in positional order, so if you want file.parquet to be the first argument of the dataset function, you must return it first. If you want a parameter to receive multiple files, return a list of the paths. For example, you would give the following return to provide a first argument with a single file and a second argument with two files:return ["file1.parquet", ["file2.parquet", "file3.parquet"]]
Parameters:
working_dirstrThe folder where the files must be stored
Returns:
Union[str, Tuple[str, ...], List[str]]: The path of the file(s) created, in the order they must be mapped to the dataset function