@@ -55,7 +55,21 @@ message DataDocumentationSpec {
5555
5656// The output of a DataDocumentation scan.
5757message DataDocumentationResult {
58- // Generated metadata about the table.
58+ // Insights for a dataset resource.
59+ message DatasetResult {
60+ // Output only. Generated Dataset description.
61+ string overview = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
62+
63+ // Output only. Relationships suggesting how tables in the dataset are
64+ // related to each other, based on their schema.
65+ repeated SchemaRelationship schema_relationships = 3
66+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
67+
68+ // Output only. Sample SQL queries for the dataset.
69+ repeated Query queries = 4 [(google.api.field_behavior ) = OUTPUT_ONLY ];
70+ }
71+
72+ // Insights for a table resource.
5973 message TableResult {
6074 // Output only. The service-qualified full resource name of the cloud
6175 // resource. Ex:
@@ -73,6 +87,69 @@ message DataDocumentationResult {
7387 repeated Query queries = 4 [(google.api.field_behavior ) = OUTPUT_ONLY ];
7488 }
7589
90+ // Details of the relationship between the schema of two resources.
91+ message SchemaRelationship {
92+ // Source which generated the schema relation edge.
93+ enum Source {
94+ // The source of the schema relationship is unspecified.
95+ SOURCE_UNSPECIFIED = 0 ;
96+
97+ // The source of the schema relationship is agent.
98+ AGENT = 4 ;
99+
100+ // The source of the schema relationship is query history from the source
101+ // system.
102+ QUERY_HISTORY = 5 ;
103+
104+ // The source of the schema relationship is table constraints added in
105+ // the source system.
106+ TABLE_CONSTRAINTS = 6 ;
107+ }
108+
109+ // The type of relationship.
110+ enum Type {
111+ // The type of the schema relationship is unspecified.
112+ TYPE_UNSPECIFIED = 0 ;
113+
114+ // Indicates a join relationship between the schema fields.
115+ SCHEMA_JOIN = 1 ;
116+ }
117+
118+ // Represents an ordered set of paths within a table's schema.
119+ message SchemaPaths {
120+ // Output only. The service-qualified full resource name of the table
121+ // Ex:
122+ // //bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID
123+ string table_fqn = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
124+
125+ // Output only. An ordered set of Paths to fields within the schema of the
126+ // table. For fields nested within a top level field of type record, use
127+ // '.' to separate field names. Examples: Top level field - `top_level`
128+ // Nested field - `top_level.child.sub_field`
129+ repeated string paths = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
130+ }
131+
132+ // Output only. An ordered list of fields for the join from the first table.
133+ // The size of this list must be the same as `right_schema_paths`.
134+ // Each field at index i in this list must correspond to a field at the same
135+ // index in the `right_schema_paths` list.
136+ SchemaPaths left_schema_paths = 1
137+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
138+
139+ // Output only. An ordered list of fields for the join from the second
140+ // table. The size of this list must be the same as `left_schema_paths`.
141+ // Each field at index i in this list must correspond to a field at the same
142+ // index in the `left_schema_paths` list.
143+ SchemaPaths right_schema_paths = 2
144+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
145+
146+ // Output only. Sources which generated the schema relation edge.
147+ repeated Source sources = 4 [(google.api.field_behavior ) = OUTPUT_ONLY ];
148+
149+ // Output only. The type of relationship between the schema paths.
150+ Type type = 6 [(google.api.field_behavior ) = OUTPUT_ONLY ];
151+ }
152+
76153 // A sample SQL query in data documentation.
77154 message Query {
78155 // Output only. The SQL query string which can be executed.
@@ -102,7 +179,11 @@ message DataDocumentationResult {
102179
103180 // The result of the data documentation scan.
104181 oneof result {
105- // Output only. Table result for insights.
182+ // Output only. Insights for a Dataset resource.
183+ DatasetResult dataset_result = 7
184+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
185+
186+ // Output only. Insights for a Table resource.
106187 TableResult table_result = 8 [(google.api.field_behavior ) = OUTPUT_ONLY ];
107188 }
108189}
0 commit comments