×

Notice

The forum is in read only mode.

Trino historical database not returning data.

4 months 4 days ago #2740 by michaelnicol
I am trying to interact with the Trino historical database to retrieve ADSB data between two times. I have the proper authentication token generation code, and below is the code designed to query Trino and then process the data.

The code below does a post request to 
    var nextURI: string | undefined;
    const queryString = `SELECT * FROM ${startTimeEPOCHMS / 1000} AND ${endTimeEPOCHMS / 1000}`;
    const response = await (
      '',
      queryString,
      {
        headers: {
          Authorization: `Bearer ${}`,
          'Content-Type': 'text/plain',
        },
      }
    );
    if (response && == 200) {
      const body = ;
      nextURI = ;
      (200);
    } else {
      throw new Error('Unokay response whilst querying OpenSky');
    };
    if (nextURI) {
      while (nextURI) {
        await fetch(nextURI, {
          method: 'GET',
          headers: {
            'Authorization': `Bearer ${}`
          }
        }).then(async (response) => {
          if (response && ) {
            // Wait for the data to arrive.
            const responseData = await ();
            // Print the columns
            ((, undefined, 2))
            if (== "FINISHED" || == "FAILED") {
              nextURI = undefined;
            } else {
              // Go to the next URI.
              nextURI = 
            }
          }
        }).catch((error) => {
          throw error;
        });
      }
    } else {
      throw new Error("No nextUri received");
    }

When I run this code with the following query:
[code]SELECT * FROM
[/code]

It takes 7.46 minutes, uses 385 NextURL links, and returns no data. When I print the columns from the body of the request, I get the following format every time:
[
  {
    "name": "time",
    "type": "integer",
    "typeSignature": {
      "rawType": "integer",
      "arguments": []
    }
  },
  {
    "name": "icao24",
    "type": "varchar",
    "typeSignature": {
      "rawType": "varchar",
      "arguments": [
        {
          "kind": "LONG",
          "value": 2147483647
        }
      ]
    }
  },
  {
    "name": "lat",
    "type": "double",
    "typeSignature": {
      "rawType": "double",
      "arguments": []
    }
  },
  {
    "name": "lon",
    "type": "double",
    "typeSignature": {
      "rawType": "double",
      "arguments": []
    }
  },
  {
    "name": "velocity",
    "type": "double",
    "typeSignature": {
      "rawType": "double",
      "arguments": []
    }
  },
  {
    "name": "heading",
    "type": "double",
    "typeSignature": {
      "rawType": "double",
      "arguments": []
    }
  },
  {
    "name": "vertrate",
    "type": "double",
    "typeSignature": {
      "rawType": "double",
      "arguments": []
    }
  },
  {
    "name": "callsign",
    "type": "varchar",
    "typeSignature": {
      "rawType": "varchar",
      "arguments": [
        {
          "kind": "LONG",
          "value": 2147483647
        }
      ]
    }
  },
  {
    "name": "onground",
    "type": "boolean",
    "typeSignature": {
      "rawType": "boolean",
      "arguments": []
    }
  },
  {
    "name": "alert",
    "type": "boolean",
    "typeSignature": {
      "rawType": "boolean",
      "arguments": []
    }
  },
  {
    "name": "spi",
    "type": "boolean",
    "typeSignature": {
      "rawType": "boolean",
      "arguments": []
    }
  },
  {
    "name": "squawk",
    "type": "varchar",
    "typeSignature": {
      "rawType": "varchar",
      "arguments": [
        {
          "kind": "LONG",
          "value": 2147483647
        }
      ]
    }
  },
  {
    "name": "baroaltitude",
    "type": "double",
    "typeSignature": {
      "rawType": "double",
      "arguments": []
    }
  },
  {
    "name": "geoaltitude",
    "type": "double",
      "rawType": "array",
      "arguments": [
        {
          "kind": "TYPE",
          "value": {
            "rawType": "integer",
            "arguments": []
          }
        }
      ]
    }
  },
  {
    "name": "hour",
    "type": "integer",
    "typeSignature": {
      "rawType": "integer",
      "arguments": []
    }
  }
]

How can I fix this? Why am I getting no data?
4 months 4 days ago #2741 by strohmeier
I don't know what this is. Anyway, I can't find any trace that you've requested and received access to the Trino database.
4 months 4 days ago #2742 by michaelnicol
The research lab I work for is a contributor, and I use those credentials. I created this account so I could post on the forums.

The ID of a similar query to the one above is 20240613_220028_57242_jtdt5.

The post above appears to have considered the example query I posted as a link and removed it.

The query of the ID I just posted is:

SELECT * FROM

I started this query before submitting this reply; it's been running for 1.63 minutes with 0B output data.
Powered by Kunena Forum
This website uses cookies to offer you the best experience of our services. By using this website you agree to our privacy policy!