Skip to main content

data_scans

Creates, updates, deletes, gets or lists a data_scans resource.

Overview

Namedata_scans
TypeResource
Idgoogle.dataplex.data_scans

Fields

NameDatatypeDescription
namestringOutput only. The relative resource name of the scan, of the form: projects/{project}/locations/{location_id}/dataScans/{datascan_id}, where project refers to a project_id or project_number and location_id refers to a GCP region.
descriptionstringOptional. Description of the scan. Must be between 1-1024 characters.
createTimestringOutput only. The time when the scan was created.
dataobjectThe data source for DataScan.
dataProfileResultobjectDataProfileResult defines the output of DataProfileScan. Each field of the table will have field type specific profile result.
dataProfileSpecobjectDataProfileScan related setting.
dataQualityResultobjectThe output of a DataQualityScan.
dataQualitySpecobjectDataQualityScan related setting.
displayNamestringOptional. User friendly display name. Must be between 1-256 characters.
executionSpecobjectDataScan execution settings.
executionStatusobjectStatus of the data scan execution.
labelsobjectOptional. User-defined labels for the scan.
statestringOutput only. Current state of the DataScan.
typestringOutput only. The type of DataScan.
uidstringOutput only. System generated globally unique ID for the scan. This ID will be different if the scan is deleted and re-created with the same name.
updateTimestringOutput only. The time when the scan was last updated.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_data_scans_getSELECTdataScansId, locationsId, projectsIdGets a DataScan resource.
projects_locations_data_scans_listSELECTlocationsId, projectsIdLists DataScans.
projects_locations_data_scans_createINSERTlocationsId, projectsIdCreates a DataScan resource.
projects_locations_data_scans_deleteDELETEdataScansId, locationsId, projectsIdDeletes a DataScan resource.
projects_locations_data_scans_patchUPDATEdataScansId, locationsId, projectsIdUpdates a DataScan resource.
projects_locations_data_scans_generate_data_quality_rulesEXECdataScansId, locationsId, projectsIdGenerates recommended data quality rules based on the results of a data profiling scan.Use the recommendations to build rules for a data quality scan.
projects_locations_data_scans_runEXECdataScansId, locationsId, projectsIdRuns an on-demand execution of a DataScan

SELECT examples

Lists DataScans.

SELECT
name,
description,
createTime,
data,
dataProfileResult,
dataProfileSpec,
dataQualityResult,
dataQualitySpec,
displayName,
executionSpec,
executionStatus,
labels,
state,
type,
uid,
updateTime
FROM google.dataplex.data_scans
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new data_scans resource.

/*+ create */
INSERT INTO google.dataplex.data_scans (
locationsId,
projectsId,
description,
displayName,
labels,
data,
executionSpec,
dataQualitySpec,
dataProfileSpec
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ description }}',
'{{ displayName }}',
'{{ labels }}',
'{{ data }}',
'{{ executionSpec }}',
'{{ dataQualitySpec }}',
'{{ dataProfileSpec }}'
;

UPDATE example

Updates a data_scans resource.

/*+ update */
UPDATE google.dataplex.data_scans
SET
description = '{{ description }}',
displayName = '{{ displayName }}',
labels = '{{ labels }}',
data = '{{ data }}',
executionSpec = '{{ executionSpec }}',
dataQualitySpec = '{{ dataQualitySpec }}',
dataProfileSpec = '{{ dataProfileSpec }}'
WHERE
dataScansId = '{{ dataScansId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified data_scans resource.

/*+ delete */
DELETE FROM google.dataplex.data_scans
WHERE dataScansId = '{{ dataScansId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';