Teradata Package for R Function Reference | 17.20 - attach_attributes - Teradata Package for R - Look here for syntax, methods and examples for the functions included in the Teradata Package for R.

Teradata® Package for R Function Reference

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for R
Release Number
17.20
Published
March 2024
ft:locale
en-US
ft:lastEdition
2024-05-03
dita:id
TeradataR_FxRef_Enterprise_1720
lifecycle
latest
Product Category
Teradata Vantage
Attach attributes to the tbl object.

Description

This function takes an existing tbl_teradata object and attaches the following attributes:

  1. databaseName - The name of the database in which the table exists.

  2. sourceDefinition - Name of the source of input i.e table name or sql query.

  3. sourceType - Type of input source i.e table or query.

  4. object - Full name of the table when source type is table, else NULL.

  5. baseQuery - Base Query for the tbl.

  6. columnDataType - DataTypes of the columns.

  7. columnNames - Names of the columns.

Usage

attach_attributes(tblObj)

Arguments

tblObj

Required Argument.
Specifies the tbl_teradata object. Types : tbl_teradata

Value

A 'tbl_teradata' object with the attributes attached.

Examples


# Get remote data source connection.
con <- td_get_context()$connection

# Load example data.
loadExampleData("antiselect_example", "antiselect_input")

# Create objects of class "tbl_teradata" with and without metadata.
tbl_antiselect <- tbl(con, "antiselect_input")
tbl_antiselect_wo_metadata <- tbl(con, "antiselect_input", ignore.metadata=T)

# Example 1: Attach the attributes to the 'tbl_antiselect' and retrieve them.
attach_attributes(tbl_antiselect)
# Retrieve the attributes using attributes()
antiselect_attr <- attributes(tbl_antiselect)

# Example 2: Attach the attributes to the 'tbl_antiselect_wo_metadata'.
attach_attributes(tbl_antiselect_wo_metadata)
# Retrieve the attributes using attributes()
antiselect_attr <- attributes(tbl_antiselect_wo_metadata)