print_sqlmr_query | Display Options | Teradata Python Package - 17.00 - print_sqlmr_query - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.00
Release Date
November 2021
Content Type
User Guide
Publication ID
B700-4006-070K
Language
English (United States)

The print_sql_mr_query option 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