Update resource reference¶
Database objects and procedures¶
The following database objects are created when the file ingestion/resource_management.sql is executed.
PUBLIC.UPDATE_ RESOURCE(resource_ ingestion_ definition_ id VARCHAR, ingestion_ configurations VARIANT)¶
Entry point procedure available to the ADMIN role. This procedure invokes the Java function UpdateResourceHandler.updateResource.
PUBLIC.UPDATE_ RESOURCE_ VALIDATE(resource_ ingestion_ definition_ id VARCHAR, ingestion_ configurations VARIANT)¶
Procedure used for connector specific validation of update process. By default, it returns 'response_code': 'OK'.
It is invoked by DefaultUpdateResourceValidator. Can be overwritten both in SQL and Java.
PUBLIC.PRE_ UPDATE_ RESOURCE(resource_ ingestion_ definition_ id VARCHAR, ingestion_ configurations VARIANT)¶
Procedure used for adding connector specific logic which is invoked before a resource is updated.
By default, it returns 'response_code': 'OK'.
It is invoked by DefaultPreUpdateResourceCallback. Can be overwritten both in SQL and Java.
PUBLIC.POST_ UPDATE_ RESOURCE(resource_ ingestion_ definition_ id VARCHAR, ingestion_ configurations VARIANT)¶
Procedure used for adding connector specific logic which is invoked after a resource is updated.
By default, it returns 'response_code': 'OK'.
It is invoked by DefaultPostUpdateResourceCallback. Can be overwritten both in SQL and Java.
Related Java objects¶
The following Java objects from the com.snowflake.connectors.application.ingestion.update package and some common components are tightly connected with the above procedures:
UpdateResourceHandlerUpdateResourceHandlerBuilderUpdateResourceValidatorPreUpdateResourceCallbackPostUpdateResourceCallbackConnectorErrorHelper
Custom handler¶
The handler and its internals can be customized using the following approaches.
Procedure replacement approach¶
The following components can be replaced using SQL.
Handler¶
To provide whole custom implementation of UpdateResourceHandler, the PUBLIC.UPDATE_RESOURCE procedure must be replaced. For example:
Internal procedures¶
Internal procedures UPDATE_RESOURCE_VALIDATE, PRE_UPDATE_RESOURCE and POST_UPDATE_RESOURCE can be also customized through the SQL. These procedures can also invoke other Java handlers:
Builder approach¶
UpdateResourceHandler can be customized using UpdateResourceHandlerBuilder. This builder allows user to provide custom implementations of the following interfaces:
UpdateResourceValidatorPreUpdateResourceCallbackPostUpdateResourceCallbackConnectorErrorHelper
In case a function is not provided the default implementation provided by the SDK will be used.