tdr.SetLocalOrderByDef Function | R Table Operators | Teradata Vantage - tdr.SetLocalOrderByDef - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

Sets the ordering specification for a specified input stream.

Syntax

tdr.SetLocalOrderByDef(  streamno,  lorderbydef  )
streamno
Parameter type: integer

The input stream number.

lorderbydef
Parameter type: list
A list of vectors with the following:
  • Column names
  • Ordering of the columns
  • NULLS FIRST/NULLS LAST indicators

Usage Notes

This function is valid only if called from the contract function.

The function must run on a PE-only node.

An error is raised in the following situations:
  • The function is called from the table operator.
  • The LOCAL ORDER BY metadata was already set.

Example: Set the LOCAL ORDER BY Specification for an Input Stream

The following statement sets the LOCAL ORDER BY specification for input stream 0 to be col1 ASC NULLS FIRST, col3 DESC NULLS LAST.

lorderbydef <- list(c("col1","A","NF"),c("col2","D","NL"))
tdr.SetLocalOrderByDef(0, lorderbydef );