Retrieve a Dataset Object | Spark SQL Initiator Connector | Teradata Fabric - getDatasetFromSql - Teradata Fabric

Teradata® Fabric - Installation and User Guide - 3.11

Product
Teradata Fabric
Release Number
3.11
Publication Date
August 2026
Content Type
Administration
Configuration
Installation
User Guide
Publication ID
B035-5991-086K
ft:locale
en-US
ft:lastEdition
2026-08-15
dita:mapPath
svw1780362788070.ditamap
dita:ditavalPath
ezw1784752870623.ditaval
ft:sourceId
dita
dita:id
lxg1591800469257

Use the getDataSetFromSql() method to perform a lazy evaluation of a SELECT query involving non-native tables. For example:

scala> ForeignServer.getDatasetFromSql("select * from default.nn1")
res0: org.apache.spark.sql.Dataset[org.apache.spark.sql.Row] = [number: int, name: string]

The query result DataSet (res0 in the example) is used like any other Spark SQL DataSet object and is only evaluated when an action is called.