Generate Destination Path Name in Subquery - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

The WRITE_NOS call in this statement includes an expression that generates a destination path name that it references in the PARTITION BY clause:

SELECT objectName FROM WRITE_NOS (
  ON (SELECT c1, c2, c3, c4, CONCAT ('year=', SUBSTR (c4,1,4)) YearPath FROM chartab1)
  PARTITION BY c1, c3, YearPath ORDER BY c1, c3, YearPath
  USING
    LOCATION ('/s3/ceph-s3.teradata.com/co255015/writes/')
    AUTHORIZATION (CEPH_AUTH)
    NAMING ('DISCRETE')
    INCLUDE_ORDERING ('FALSE')
    STOREDAS ('PARQUET')
) AS d;
Query completed. 6 rows found. One column returned.
Total elapsed time was 1 second.
ObjectName
---------------------------------------------------------------------------
/S3/ceph-s3.teradata.com/co255015/writes/8/70/year=1999/object_33_0_1.parquet
/S3/ceph-s3.teradata.com/co255015/writes/2/10/year=2010/object_33_1_1.parquet
/S3/ceph-s3.teradata.com/co255015/writes/4/60/year=2015/object_33_3_1.parquet
/S3/ceph-s3.teradata.com/co255015/writes/5/60/year=2015/object_33_5_1.parquet
/S3/ceph-s3.teradata.com/co255015/writes/7/70/year=1999/object_33_6_1.parquet
/S3/ceph-s3.teradata.com/co255015/writes/1/10/year=2010/object_33_7_1.parquet