print_sqlmr_query - Teradata Python Package

Teradata® Python Package User Guide

Product
Teradata Python Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-29
dita:mapPath
rkb1531260709148.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage

The print_sql_mr_query parameter is a boolean that controls whether or not to print the query being sent to 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