How to recognize different data sources in a query?

For example, we have a heterogeneous PartiQL query.

  1. how to recognize from query syntax it is heterogenous ?
  2. how to recognize to what data sources this query?
    I.e. user wants to query PostgreSQL, Redshift, SQL Server.
    How to understand what db servers exactly user needs?

Anybody can explain me how to?
I did not find it in the language specification.
Thanx.

Sorry for the delay…

I’m not sure I understand your question here. What do you mean by an “heterogeneous” PartiQL Query?

Sorry for the unclear question.
As I understand from the doc “PartiQL provides SQL-compatible unified query access across multiple data stores”: i.e. one PartiQL query can contain set of queries to different data sources. Is it?
If so lets imagine: I develop my own PartiQL parser and interpreter to use it in a local environment. That’s why the question about recognizing the data sources in a query.

Thanks for the clarification.

The data source identification is normally determined by a notion of a catalog which is implementation specific as that’s outside the scope of the specification.

For example in the reference implementation the Bindings interface defines an environment and the environment set in EvaluationSession#globals is effectively the catalog for that session. When looking up a binding, e.g. a table, the Bindings implementation will return the corresponding value which is mapped to the correct data source. Take a look at this example, it creates a session with an in memory table bound to the name myCsvDocument, but it could be bounding that name to a file, a table in Postgres, etc.

As I mentioned before the determining which table comes from which data store is implementation specific and what the it’s implemented in the reference implementation is a way to do it but there are multiple ways of doing it and each implementation will have to consider different trade offs when implementing it.