From 16f41ff45fce953fd50292dcd43b22e5c70df58f Mon Sep 17 00:00:00 2001 From: Dongwei Wang Date: Wed, 25 Apr 2018 20:07:47 -0700 Subject: [PATCH] [ADLA] - Catalog - Support table preview * Retrieves a preview set of rows in given table * Retrieves a preview set of rows in given partition --- .../stable/2016-11-01/catalog.json | 171 ++++++++++++++++++ .../examples/Catalog_PreviewTable.json | 31 ++++ .../Catalog_PreviewTablePartition.json | 32 ++++ 3 files changed, 234 insertions(+) create mode 100644 specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/examples/Catalog_PreviewTable.json create mode 100644 specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/examples/Catalog_PreviewTablePartition.json diff --git a/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/catalog.json b/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/catalog.json index a09528e7a132..243773558373 100644 --- a/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/catalog.json +++ b/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/catalog.json @@ -1676,6 +1676,77 @@ "x-ms-odata": "#/definitions/USqlTableStatistics" } }, + "/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}/previewrows": { + "get": { + "tags": [ + "Catalog" + ], + "operationId": "Catalog_PreviewTablePartition", + "description": "Retrieves a preview set of rows in given partition.", + "parameters": [ + { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database containing the partition." + }, + { + "name": "schemaName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the schema containing the partition." + }, + { + "name": "tableName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the table containing the partition." + }, + { + "name": "partitionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the table partition." + }, + { + "name": "maxRows", + "in": "query", + "required": false, + "type": "integer", + "format": "int64", + "description": "The maximum number of preview rows to be retrieved.Rows returned may be less than or equal to this number depending on row sizes and number of rows in the partition." + }, + { + "name": "maxColumns", + "in": "query", + "required": false, + "type": "integer", + "format": "int64", + "description": "The maximum number of columns to be retrieved." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved preview rows for the specified partition.", + "schema": { + "$ref": "#/definitions/USqlTablePreview" + } + } + }, + "x-ms-examples": { + "Retrieves a preview set of rows in given partition": { + "$ref": "./examples/Catalog_PreviewTablePartition.json" + } + } + } + }, "/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}": { "get": { "tags": [ @@ -1731,6 +1802,70 @@ } } }, + "/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/previewrows": { + "get": { + "tags": [ + "Catalog" + ], + "operationId": "Catalog_PreviewTable", + "description": "Retrieves a preview set of rows in given table.", + "parameters": [ + { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database containing the table." + }, + { + "name": "schemaName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the schema containing the table." + }, + { + "name": "tableName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the table." + }, + { + "name": "maxRows", + "in": "query", + "required": false, + "type": "integer", + "format": "int64", + "description": "The maximum number of preview rows to be retrieved. Rows returned may be less than or equal to this number depending on row sizes and number of rows in the table." + }, + { + "name": "maxColumns", + "in": "query", + "required": false, + "type": "integer", + "format": "int64", + "description": "The maximum number of columns to be retrieved." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved preview rows for the specified table.", + "schema": { + "$ref": "#/definitions/USqlTablePreview" + } + } + }, + "x-ms-examples": { + "Retrieves a preview set of rows in given table": { + "$ref": "./examples/Catalog_PreviewTable.json" + } + } + } + }, "/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions": { "get": { "tags": [ @@ -3657,6 +3792,42 @@ }, "description": "A Data Lake Analytics catalog type field information item." }, + "USqlTablePreview": { + "properties": { + "totalRowCount": { + "type": "integer", + "format": "int64", + "description": "the total number of rows in the table or partition." + }, + "totalColumnCount": { + "type": "integer", + "format": "int64", + "description": "the total number of columns in the table or partition." + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "the rows of the table or partition preview, where each row is an array of string representations the row's values. Note: Byte arrays will appear as base-64 encoded values, SqlMap and SqlArray objects will appear as escaped JSON objects, and DateTime objects will appear as ISO formatted UTC date-times." + }, + "truncated": { + "type": "boolean", + "description": "true if the amount of data in the response is less than expected due to the preview operation's size limitations. This can occur if the requested rows or row counts are too large." + }, + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/USqlTableColumn" + }, + "description": "the schema of the table or partition." + } + }, + "description": "A Data Lake Analytics catalog table or partition preview rows item." + }, "USqlTable": { "allOf": [ { diff --git a/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/examples/Catalog_PreviewTable.json b/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/examples/Catalog_PreviewTable.json new file mode 100644 index 000000000000..cd981e4bd261 --- /dev/null +++ b/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/examples/Catalog_PreviewTable.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2016-11-01", + "accountName": "contosoadla", + "adlaCatalogDnsSuffix": "azuredatalakeanalytics.net", + "databaseName": "master", + "schemaName": "dbo", + "tableName": "test_table_name" + }, + "responses": { + "200": { + "body": { + "totalRowCount": 1, + "totalColumnCount": 2, + "rows": [ + [ + "value_a", + "value_b" + ] + ], + "truncated": false, + "schema": [ + { + "name": "test_column_name", + "type": "test_data_type" + } + ] + } + } + } +} diff --git a/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/examples/Catalog_PreviewTablePartition.json b/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/examples/Catalog_PreviewTablePartition.json new file mode 100644 index 000000000000..e3d94341007c --- /dev/null +++ b/specification/datalake-analytics/data-plane/Microsoft.DataLakeAnalytics/stable/2016-11-01/examples/Catalog_PreviewTablePartition.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "api-version": "2016-11-01", + "accountName": "contosoadla", + "adlaCatalogDnsSuffix": "azuredatalakeanalytics.net", + "databaseName": "master", + "schemaName": "dbo", + "tableName": "test_table_name", + "partitionName": "test_partition_name" + }, + "responses": { + "200": { + "body": { + "totalRowCount": 1, + "totalColumnCount": 2, + "rows": [ + [ + "value_a", + "value_b" + ] + ], + "truncated": false, + "schema": [ + { + "name": "test_column_name", + "type": "test_data_type" + } + ] + } + } + } +}