print_sqlmr_query

Teradata® Python Package User Guide

brand
Teradata Vantage
prodname
Teradata Python Package
vrm_release
16.20
category
User Guide
featnum
B700-4006-098K

The print_sql_mr_query parameter is a boolean that controls whether or not to print the query being sent to Teradata Vantage when an analytic function is called. The default is False.

Example: Set the value to True

>>> display.print_sqlmr_query = True
>>> from teradataml.analytics.KMeans import KMeans

>>> computers_train1 = DataFrame.from_table("computers_train1")
>>> kmeanssample_centroid = DataFrame.from_table("kmeanssample_centroid")
>>> result = KMeans(data=computers_train1,
                        centroids_table=kmeanssample_centroid,
                        centers=8,
                        threshold=0.0395,
                        iter_max=10,
                        unpack_columns=False,
                        seed=10,
                        data_sequence_column='primary_index'
                        )

 
SELECT * FROM KMeans(
    ON "computers_train1" AS InputTable
    ON "kmeanssample_centroid" AS CentroidsTable
    OUT TABLE OutputTable(TDML.ml__td_kmeans0_1538706050004791)
    OUT TABLE ClusteredOutput(TDML.ml__td_kmeans1_1538702918024205)
    USING
    NumClusters('8')
    MaxIterNum('10')
    Seed('10')
    SequenceInputBy('InputTable:primary_index')
) as sqlmr