streamResultsFromQuery API | Java SDK | Teradata AppCenter - 2.0 - streamResultsFromQuery API - Teradata AppCenter

Teradata® AppCenter Java SDK User Guide

prodname
Teradata AppCenter
vrm_release
2.0
created_date
September 2020
category
Programming Reference
User Guide
featnum
B035-1118-090K

Purpose

The streamResultsFromQuery API queries Teradata Database, Teradata Vantage, Aster Database, and returns results as an InputStream.

Java Code Example

InputStream queryResultStream = client.streamResultsFromQuery(query);

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
        },
        ……
      ]
    }
  ]
}