0

I am creating a DDL file to be deployed as VDB using TEIID. The source model is MS SQl. In the source database there is geography data type column. I am trying to read the lat and long from geography data type.

To retrieve the lat/long in sql server:

db.geogCol.Lat
db.geogCol.Long

When creating a view in ddl file using select statement and trying to retrieve the lat/long by passing to teiid, an exception is thrown. Teiid seems to think .Lat and .Long are columns whereas they are sql server function tied to the geography data column. How can i execute this so it treats the above arguments as ms-sql

4

1 回答 1

0

最接近的表示是源函数。您将需要创建源函数来表示它们。在 sql server 架构上:

create foreign function lat (geography geog) returns double
  OPTIONS ("teiid_rel:native-query" '$1.Lat');

和 Long 类似的。

Teiid 确实有 st_x 和 st_y 函数,但我认为它们目前没有资格下推到 sql server。

于 2020-04-07T17:28:31.597 回答