query API | Python SDK | Teradata AppCenter - query API - Teradata AppCenter

Teradata® AppCenter Python SDK User Guide

Product
Teradata AppCenter
Release Number
1.10
Published
July 2020
Language
English (United States)
Last Update
2020-07-13
dita:mapPath
jfn1593439363205.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-1119
lifecycle
previous
Product Category
Analytical Ecosystem

Purpose

The query API queries Teradata Database, Teradata Vantage, and Aster Database and returns results as a JSON string.

Python Code Example

API Call Code
Query API call invocation
query_result = client.query(query='select issue as term , count ( * ) as tf_idf from consumer_complaints group by issue')

Result Example

In the following example, the output JSON "columns" section contains column metadata describing the name and type of every column. The "data" section contains data from the query.
{
  "queueDuration": 33,
  "queryDuration": 47646,
  "results": [
    {
      "resultSet": true,
      "columns": [
        {
          "name": "issue",
          "type": "varchar"
        },
        {
          "name": "issue_count",
          "type": "bigint"
        }
      ],
      "data": [
        {
          "issue": "APR or interest rate",
          "issue_count": 125
        },
        {
          "issue": "Account opening, closing, or management",
          "issue_count": 804
        },
        ……
      ]
    }
  ]
}