none
Why Doesn't This Query Fold? RRS feed

  • Question

  • let
        Source = #"EDW PRCRMNT_SPEND_DTL",
        #"Removed Columns" = Table.RemoveColumns( Source, {"SPEND_USD_AMT"} ),
        #"Removed Duplicates" = Table.Distinct( #"Removed Columns" ),
        #"Merged Queries" = Table.NestedJoin( #"Removed Duplicates", {"CMPNY_CD", "SRC_SYS_CD", "SPEND_FSCL_QTR_NUM", "GL_ACCT_NUM", "RGN_CD", "VNDR_CORP_NAM", "PRCRMNT_RPTNG_LVL_2_TXT", "PRCRMNT_RPTNG_LVL_3_TXT", "NXP_Commodity"}, #"EDW PRCRMNT_SPEND_DTL", {"CMPNY_CD", "SRC_SYS_CD", "SPEND_FSCL_QTR_NUM", "GL_ACCT_NUM", "RGN_CD", "VNDR_CORP_NAM", "PRCRMNT_RPTNG_LVL_2_TXT", "PRCRMNT_RPTNG_LVL_3_TXT", "NXP_Commodity"}, "NewColumn", JoinKind.Inner),
        #"Aggregated NewColumn" = Table.AggregateTableColumn( #"Merged Queries", "NewColumn", {{"SPEND_USD_AMT", List.Sum, "Sum of SPEND_USD_AMT"}} )
    in
        #"Aggregated NewColumn"
    I should mention that the Source is a view in our Teradata database.

    Thursday, April 14, 2016 4:58 PM

Answers

  • Hi Mark,

    Ok, now I see the problem. Converting that column to a Currency type too early breaks the folding.

    My recommendation would be to move that step to the end to have the best folding experience.

    • Marked as answer by Mark Weisman Saturday, April 30, 2016 1:48 AM
    Friday, April 29, 2016 8:05 PM
    Moderator

All replies

  • Haven't worked with Teradata but assuming that it generally folds.

    In the Merge-operation you're reaching out to another query. If this table is longer than 200 rows, the folding-bug might kick in (just a guess): http://www.thebiccountant.com/2015/09/17/filter-sql-server-queries-with-excel-tables-query-folding-limitations-and-bug-workaround/

    A bit irritated that the right table (which should be the filter-table if you're using a InnerJoin) seems to be the same than the source of your current query (and the Aggregate column being the one that should have been removed in the 2nd step)?


    Imke Feldmann TheBIccountant.com

    Thursday, April 14, 2016 7:14 PM
    Moderator
  • The reference you provided concerns filtering using data found on an Excel worksheet.  In my case all filtering (in #"EDW PRCRMNT_SPEND_DTL" ) is applied to a Teradata table using the Power Query interface.  You can think of #"EDW PRCRMNT_SPEND_DTL" as a simple view of a native Teradata table.  This "view" includes more than 400,000 records ... and, as my query runs I can see the row counter count up to this value which suggests to me that query folding isn't happening.  

    Thursday, April 14, 2016 8:05 PM
  • Is it possible that Table.NestedJoin won't query fold in Teradata?
    Thursday, April 14, 2016 9:07 PM
  • It seems somewhat unlikely. I know we've had some issues with "distinct" before, though. When you enable tracing and look at the trace log, you should be able to see the query we actually send to Teradata. What is it?
    Thursday, April 14, 2016 10:09 PM
  • 	Line 136: DataMashup.Trace Information: 24579 : {"Start":"2016-04-14T22:54:15.2374336Z","Action":"Engine/IO/Db/Teradata/ExecuteReader","CommandText":"select distinct \"_\".\"CMPNY_CD\",\r\n    \"_\".\"SRC_SYS_CD\",\r\n    \"_\".\"SPEND_FSCL_QTR_NUM\",\r\n    \"_\".\"SPEND_FSCL_YR_NUM\",\r\n    \"_\".\"GL_ACCT_NUM\",\r\n    \"_\".\"GL_ACCT_DESC\",\r\n    \"_\".\"RGN_CD\",\r\n    \"_\".\"VNDR_CORP_NAM\",\r\n    \"_\".\"PRCRMNT_RPTNG_LVL_2_TXT\",\r\n    \"_\".\"PRCRMNT_RPTNG_LVL_3_TXT\",\r\n    \"_\".\"NXP_Commodity\"\r\nfrom \"EDW\".\"PRCRMNT_SPEND_DTL\" \"_\"\r\nwhere (\"_\".\"SPEND_FSCL_YR_NUM\" = 2016 and \"_\".\"SPEND_FSCL_YR_NUM\" is not null) and (\"_\".\"SRC_SYS_CD\" <> 'ATL_SAVINGS' or \"_\".\"SRC_SYS_CD\" is null)","ResponseFieldCount":"11","ProductVersion":"2.30.4246.1721 (Stabilization)","ActivityId":"bfdbe030-0345-49ac-acc0-cd3759d8c0a5","Process":"Microsoft.Mashup.Container.NetFX40","Pid":14832,"Tid":1,"Duration":"00:00:01.3526609"}
    	Line 141: DataMashup.Trace Information: 24579 : {"Start":"2016-04-14T22:54:16.6347590Z","Action":"Engine/IO/Db/Teradata/ExecuteReader","CommandText":"select \"_\".\"CMPNY_CD\",\r\n    \"_\".\"SRC_SYS_CD\",\r\n    \"_\".\"SPEND_FSCL_QTR_NUM\",\r\n    \"_\".\"SPEND_FSCL_YR_NUM\",\r\n    \"_\".\"GL_ACCT_NUM\",\r\n    \"_\".\"GL_ACCT_DESC\",\r\n    \"_\".\"RGN_CD\",\r\n    \"_\".\"VNDR_CORP_NAM\",\r\n    \"_\".\"SPEND_USD_AMT\",\r\n    \"_\".\"PRCRMNT_RPTNG_LVL_2_TXT\",\r\n    \"_\".\"PRCRMNT_RPTNG_LVL_3_TXT\",\r\n    \"_\".\"NXP_Commodity\"\r\nfrom \"EDW\".\"PRCRMNT_SPEND_DTL\" \"_\"\r\nwhere (\"_\".\"SPEND_FSCL_YR_NUM\" = 2016 and \"_\".\"SPEND_FSCL_YR_NUM\" is not null) and (\"_\".\"SRC_SYS_CD\" <> 'ATL_SAVINGS' or \"_\".\"SRC_SYS_CD\" is null)","ResponseFieldCount":"12","ProductVersion":"2.30.4246.1721 (Stabilization)","ActivityId":"bfdbe030-0345-49ac-acc0-cd3759d8c0a5","Process":"Microsoft.Mashup.Container.NetFX40","Pid":14832,"Tid":1,"Duration":"00:00:01.3542870"}
    
    Curt, does this have any meaning to you?
    Thursday, April 14, 2016 11:09 PM
  • Let me make that  more readable :)

    (The 2 differences are, the first query doesn't select "SPEND_USD_AMT" column, and it applies 'distinct')

    select distinct "_"."CMPNY_CD",
        "_"."SRC_SYS_CD",
        "_"."SPEND_FSCL_QTR_NUM",
        "_"."SPEND_FSCL_YR_NUM",
        "_"."GL_ACCT_NUM",
        "_"."GL_ACCT_DESC",
        "_"."RGN_CD",
        "_"."VNDR_CORP_NAM",
        "_"."PRCRMNT_RPTNG_LVL_2_TXT",
        "_"."PRCRMNT_RPTNG_LVL_3_TXT",
        "_"."NXP_Commodity"
    from "EDW"."PRCRMNT_SPEND_DTL" "_"
    where
        ("_"."SPEND_FSCL_YR_NUM" = 2016
            and "_"."SPEND_FSCL_YR_NUM" is not null)
        and
        ("_"."SRC_SYS_CD" <> 'ATL_SAVINGS'
            or "_"."SRC_SYS_CD" is null)

    select "_"."CMPNY_CD",
        "_"."SRC_SYS_CD",
        "_"."SPEND_FSCL_QTR_NUM",
        "_"."SPEND_FSCL_YR_NUM",
        "_"."GL_ACCT_NUM",
        "_"."GL_ACCT_DESC",
        "_"."RGN_CD",
        "_"."VNDR_CORP_NAM",
        "_"."SPEND_USD_AMT",
        "_"."PRCRMNT_RPTNG_LVL_2_TXT",
        "_"."PRCRMNT_RPTNG_LVL_3_TXT",
        "_"."NXP_Commodity"
    from "EDW"."PRCRMNT_SPEND_DTL" "_"
    where 
        ("_"."SPEND_FSCL_YR_NUM" = 2016 
            and "_"."SPEND_FSCL_YR_NUM" is not null) 
        and 
        ("_"."SRC_SYS_CD" <> 'ATL_SAVINGS' 
            or "_"."SRC_SYS_CD" is null)
    Friday, April 15, 2016 1:26 AM
    Moderator
  • That's correct, as I said a guess, because in older versions there have been issues with folding across queries - so this might have been a residual here.

    I finally understood your code and think that grouping might be better here: Starting with the Source-step -> check all columns you used for the merge -> transform -> Group by (all cols are preselected already) -> choose SUM as the aggregation on "SPD_USD_AMT".


    Imke Feldmann TheBIccountant.com

    Friday, April 15, 2016 5:33 AM
    Moderator
  • Those queries strongly suggest that it is indeed the join which isn't folding, but I don't see any obvious reason for that. Can I safely assume that none of those fields have type "Clob" or "Blob"? Can you provide a "create table" statement which would let us try to reproduce things here?

    To Imke's point, is there any reason this isn't just a "group by"? Even though the join approach should be working, I prefer to give query optimizers as little work as possible :).

    Friday, April 15, 2016 1:48 PM
  • Curt (and, Imke), originally my Power Query was written using Table.Group, but it suffered from the same performance (see my description above) as the existing query.  As a benchmark this query runs in the blink of an eye (without downloading ~400K rows from the source table) ... 

    let
        Source = Teradata.Database("xxx.net", [Query="SELECT CMPNY_CD, SRC_SYS_CD, SPEND_FSCL_QTR_NUM, SPEND_FSCL_YR_NUM, GL_ACCT_NUM, GL_ACCT_DESC, RGN_CD, VNDR_CORP_NAM, PRCRMNT_RPTNG_LVL_2_TXT, PRCRMNT_RPTNG_LVL_3_TXT, NXP_Commodity, SUM( SPEND_USD_AMT) FROM EDW.PRCRMNT_SPEND_DTL WHERE SPEND_FSCL_YR_NUM = 2016 AND SRC_SYS_CD <> 'ATL_SAVINGS' GROUP BY CMPNY_CD, SRC_SYS_CD, SPEND_FSCL_QTR_NUM, SPEND_FSCL_YR_NUM, GL_ACCT_NUM, GL_ACCT_DESC, RGN_CD, VNDR_CORP_NAM, PRCRMNT_RPTNG_LVL_2_TXT, PRCRMNT_RPTNG_LVL_3_TXT, NXP_Commodity"])
    in
        Source

    Curt, you may safely assume that all of those fields are text or numeric.  I'm not quite sure what you're requesting by a "create table" statement.  By chance are you asking to see the how Teradata "sees" the query?  If so, I may be able to get my DBA to log and capture it for me.




    Friday, April 15, 2016 2:36 PM
  • Every manually written SQL-command will break query-folding. You would need to do it like I said / using M.

    In my article above you'll find a reference to Koen's article which I strongly recommend. He's giving other examples as well that might break folding.


    Imke Feldmann TheBIccountant.com

    Friday, April 15, 2016 2:43 PM
    Moderator
  • Imke, the SQL statement (above) which produces the desired results is intended to further demonstrate that my "pure" Power Query Language approach isn't query folding.  I know better than to expect a mashup of SQL and Power Query Language to query fold.
    Friday, April 15, 2016 2:47 PM
  • Hmm... so the Table.Group also didn't fold? This suggests to me that there's something about the field types that we didn't like, so the specific table schema would definitely be interesting.

    Friday, April 15, 2016 3:03 PM
  • Oh yes - now I see. Sorry about the confusion!

    Over & out


    Imke Feldmann TheBIccountant.com

    Friday, April 15, 2016 3:04 PM
    Moderator
  • Yes, Table.Group didn't fold.  Is it the UNICODE character type for "NXP_Commodity"?

    Oops, I forgot to include the column that I summed ... 





    Friday, April 15, 2016 3:20 PM
  • Hmmm  ... Evidently, UNICODE isn't the culprit.  I removed the NXP_Commodity column from my query, and it still didn't fold.
    Friday, April 15, 2016 3:28 PM
  • Sorry -- misunderstanding on my part. We're still investigating; right now it looks like we don't fold to Teradata when grouping by more than one column and we're not sure why.
    Friday, April 22, 2016 9:00 PM
  • Hi Mark,

    My bad, initially I did a small test and I thought it's because there are multiple columns. But apparently we still fold that.

    I've created an example table that looks like yours:

    create table doesfold(
    	CMPNY_CD char character set LATIN,
    	SRC_SYS_CD varchar(200) character set LATIN, 
    	SPEND_FSCL_QTR_NUM integer, 
    	SPEND_FSCL_YR_NUM smallint, 
    	GL_ACCT_NUM char character set LATIN, 
    	GL_ACCT_DESC varchar(200) character set LATIN, 
    	RGN_CD char character set LATIN,
    	NXP_Commodity varchar(200) character set UNICODE,
    	SPEND_USD_AMT decimal);

    And I wrote this M query:

        #"Filtered Rows" = Table.SelectRows(doesfold , each [SPEND_FSCL_YR_NUM] = 2016 and [SRC_SYS_CD] <> "ATL_SAVINGS"),
        #"Grouped Rows" = Table.Group(#"Filtered Rows" , 
    {"CMPNY_CD", "SRC_SYS_CD", "SPEND_FSCL_QTR_NUM", "SPEND_FSCL_YR_NUM", "GL_ACCT_NUM", "GL_ACCT_DESC", "RGN_CD", "NXP_Commodity"}
    , {{"Total", each List.Sum([SPEND_USD_AMT]), type number}} )

    It folded:

    select top 4096
        "rows"."CMPNY_CD" as "CMPNY_CD",
        "rows"."SRC_SYS_CD" as "SRC_SYS_CD",
        "rows"."SPEND_FSCL_QTR_NUM" as "SPEND_FSCL_QTR_NUM",
        "rows"."SPEND_FSCL_YR_NUM" as "SPEND_FSCL_YR_NUM",
        "rows"."GL_ACCT_NUM" as "GL_ACCT_NUM",
        "rows"."GL_ACCT_DESC" as "GL_ACCT_DESC",
        "rows"."RGN_CD" as "RGN_CD",
        "rows"."NXP_Commodity" as "NXP_Commodity",
        sum("rows"."SPEND_USD_AMT") as "Total"
    from 
    (
        select "_"."CMPNY_CD",
            "_"."SRC_SYS_CD",
            "_"."SPEND_FSCL_QTR_NUM",
            "_"."SPEND_FSCL_YR_NUM",
            "_"."GL_ACCT_NUM",
            "_"."GL_ACCT_DESC",
            "_"."RGN_CD",
            "_"."NXP_Commodity",
            "_"."SPEND_USD_AMT"
        from "Northwind"."doesfold" "_"
        where ("_"."SPEND_FSCL_YR_NUM" = 2016 and "_"."SPEND_FSCL_YR_NUM" is not null) and ("_"."SRC_SYS_CD" <> 'ATL_SAVINGS' or "_"."SRC_SYS_CD" is null)
    ) "rows"
    group by "CMPNY_CD",
        "SRC_SYS_CD",
        "SPEND_FSCL_QTR_NUM",
        "SPEND_FSCL_YR_NUM",
        "GL_ACCT_NUM",
        "GL_ACCT_DESC",
        "RGN_CD",
        "NXP_Commodity"
    Can you help me reproduce this? What did I do differently?

    Thanks

    Wednesday, April 27, 2016 12:06 AM
    Moderator
  • Ok, one difference is, mine is a table. At first it didn't fold against the view, but then it did after retrying:

    select "$Outer"."CMPNY_CD",
        "$Outer"."SRC_SYS_CD",
        "$Outer"."SPEND_FSCL_QTR_NUM",
        "$Outer"."SPEND_FSCL_YR_NUM",
        "$Outer"."GL_ACCT_NUM",
        "$Outer"."GL_ACCT_DESC",
        "$Outer"."RGN_CD",
        "$Outer"."NXP_Commodity",
        "$Inner"."CMPNY_CD2",
        "$Inner"."SRC_SYS_CD2",
        "$Inner"."SPEND_FSCL_QTR_NUM2",
        "$Inner"."SPEND_FSCL_YR_NUM2",
        "$Inner"."GL_ACCT_NUM2",
        "$Inner"."GL_ACCT_DESC2",
        "$Inner"."RGN_CD2",
        "$Inner"."NXP_Commodity2",
        "$Inner"."SPEND_USD_AMT"
    from 
    (
        select distinct "CMPNY_CD",
            "SRC_SYS_CD",
            "SPEND_FSCL_QTR_NUM",
            "SPEND_FSCL_YR_NUM",
            "GL_ACCT_NUM",
            "GL_ACCT_DESC",
            "RGN_CD",
            "NXP_Commodity"
        from "Northwind"."doesfoldview" as "$Table"
    ) as "$Outer"
    inner join 
    (
        select "_"."CMPNY_CD" as "CMPNY_CD2",
            "_"."SRC_SYS_CD" as "SRC_SYS_CD2",
            "_"."SPEND_FSCL_QTR_NUM" as "SPEND_FSCL_QTR_NUM2",
            "_"."SPEND_FSCL_YR_NUM" as "SPEND_FSCL_YR_NUM2",
            "_"."GL_ACCT_NUM" as "GL_ACCT_NUM2",
            "_"."GL_ACCT_DESC" as "GL_ACCT_DESC2",
            "_"."RGN_CD" as "RGN_CD2",
            "_"."NXP_Commodity" as "NXP_Commodity2",
            "_"."SPEND_USD_AMT" as "SPEND_USD_AMT"
        from "Northwind"."doesfoldview" as "_"
    ) as "$Inner" on (((((("$Outer"."CMPNY_CD" = "$Inner"."CMPNY_CD2" or "$Outer"."CMPNY_CD" is null and "$Inner"."CMPNY_CD2" is null) and ("$Outer"."SRC_SYS_CD" = "$Inner"."SRC_SYS_CD2" or "$Outer"."SRC_SYS_CD" is null and "$Inner"."SRC_SYS_CD2" is null)) and ("$Outer"."SPEND_FSCL_QTR_NUM" = "$Inner"."SPEND_FSCL_QTR_NUM2" or "$Outer"."SPEND_FSCL_QTR_NUM" is null and "$Inner"."SPEND_FSCL_QTR_NUM2" is null)) and ("$Outer"."GL_ACCT_NUM" = "$Inner"."GL_ACCT_NUM2" or "$Outer"."GL_ACCT_NUM" is null and "$Inner"."GL_ACCT_NUM2" is null)) and ("$Outer"."RGN_CD" = "$Inner"."RGN_CD2" or "$Outer"."RGN_CD" is null and "$Inner"."RGN_CD2" is null)) and ("$Outer"."NXP_Commodity" = "$Inner"."NXP_Commodity2" or "$Outer"."NXP_Commodity" is null and "$Inner"."NXP_Commodity2" is null));

    Maybe when it wasn't folding, it was just calculating the preview on the previous steps? Does it still not fold if you refresh the query on the last step? (or when loading to worksheet)

    Wednesday, April 27, 2016 12:55 AM
    Moderator
  • Oguz, thank you for your tenacity.  I have the same behavior for subsequent refreshes of the last step ... downloads rows (+450k)  from Teradata before performing the Grouping. 

    In you comments above ... are you suggesting that Power Query treats Teradata Views differently than Tables? My concern is that typically, our IT allows self-serve users to access views -- NOT base tables.

    Thursday, April 28, 2016 5:04 PM
  • No, that was just the only difference I could see, I was not sure that's the main difference:)

    One thing, we fold at the last step, but since you're on the Query Editor, it calculates previous steps separately sometimes for various reasons, and the queries you've seen were the previous steps (at least in my experimentation). I believe if you load it into worksheet, it won't separately calculate the previous steps and will fold better.

    Basically, we don't fold NestedJoin if your table (or in this case, view) doesn't have primary keys. But we do fold if you apply AggregateTableColumns(which requires less columns to show) afterwards.

    Thursday, April 28, 2016 10:25 PM
    Moderator
  • Oguz, I see the download of +450k rows even when I load the results (only ~9.5k rows) to a worksheet, and refresh the resultant table on that worksheet.

    Why does folding depend on having primary keys?

    Thursday, April 28, 2016 10:35 PM
  • It depends on having a key, because when doing a nested join, we expand all of them and match them. (Unless there's an aggregate coming afterwards, of course). If it doesn't have it, we create a local key that we can't fold.

    I'm not sure what other differences our queries have, it's weird that it still pulls +450k rows. As I showed in my reply yesterday, I was able to see that we fold the query that way. Are you trying your original query with the Group? Can you share your M query with grouping so I can try doing the same query?

    Thursday, April 28, 2016 11:18 PM
    Moderator
  • Here's the Power Query Language code for the grouped approach ... 

    let
        Source = Teradata.Database("xxx.net"),
        EDW_PRCRMNT_SPEND_DTL = Source{[Schema="EDW",Item="PRCRMNT_SPEND_DTL"]}[Data],
        #"Changed Type" = Table.TransformColumnTypes(EDW_PRCRMNT_SPEND_DTL,{{"SPEND_USD_AMT", Currency.Type}}),
        #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([SPEND_FSCL_YR_NUM] = 2016)),
        #"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each [SRC_SYS_CD] <> "ATL_SAVINGS"),
        #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows1",{"CMPNY_CD", "SRC_SYS_CD", "SPEND_FSCL_QTR_NUM", "SPEND_FSCL_YR_NUM", "GL_ACCT_NUM", "GL_ACCT_DESC", "RGN_CD", "VNDR_CORP_NAM", "SPEND_USD_AMT", "PRCRMNT_RPTNG_LVL_2_TXT", "PRCRMNT_RPTNG_LVL_3_TXT", "NXP_Commodity"}),
        #"Grouped Rows" = Table.Group(#"Removed Other Columns", {"CMPNY_CD", "SRC_SYS_CD", "SPEND_FSCL_QTR_NUM", "SPEND_FSCL_YR_NUM", "GL_ACCT_NUM", "GL_ACCT_DESC", "RGN_CD", "VNDR_CORP_NAM", "PRCRMNT_RPTNG_LVL_2_TXT", "PRCRMNT_RPTNG_LVL_3_TXT", "NXP_Commodity"}, {{"Spend_Usd_Amt", each List.Sum([SPEND_USD_AMT]), type number}})
    in
        #"Grouped Rows"


    Friday, April 29, 2016 2:09 PM
  • Hi Mark,

    Ok, now I see the problem. Converting that column to a Currency type too early breaks the folding.

    My recommendation would be to move that step to the end to have the best folding experience.

    • Marked as answer by Mark Weisman Saturday, April 30, 2016 1:48 AM
    Friday, April 29, 2016 8:05 PM
    Moderator
  • Is it the Currency type that's the problem or any type?  I'm concerned that automatic type detection will be a thorn in our side.
    Friday, April 29, 2016 8:20 PM
  • OMG!  After removal of the Currency type change ... the Nested Join folds too.
    Friday, April 29, 2016 8:28 PM
  • We're still working on folding the type transformations, but for now it'll be better if you do that step after the other steps :)

    Friday, April 29, 2016 10:26 PM
    Moderator
  • I implore you to expedite your work on folding type changes because our casual self-serve users may not be familiar with disabling Automatic Type Detection on each new workbook (a recently added feature) before beginning a new Power Query.  Failing to do so will leave a lasting impression that Power Query inherently under performs when compared to native Teradata SQL.  Is there any way to make the disabling of Automatic Type Detection a global Power Query setting rather than one associated with the current workbook?

    Note: At work I'm using Excel 2013 where this problem is of great concern.  Tonight I'll check the Get & Transform option settings in Excel 2016 on my personal Surface Book.

    Friday, April 29, 2016 11:06 PM
  • Hi again Mark,

    I wanted to check this out for myself, but looks like Teradata doesn't have a currency type (correct me if I'm wrong). In this case, I think we'll try to treat it as a decimal.

    You're saying that type conversion came with Automatic Type Detection, right? Can you help me recreate the table/view that made the Power Query automatically see that field as a currency type?

    Thanks!

    Friday, May 6, 2016 7:24 PM
    Moderator
  • Yes, please treat as decimal with 2 decimal places.

    In the case discussed in this thread Automatic Type Detection didn't produce the type change -- it was introduced by the self-serve user.  I have seen Automatic Type Detection introduce a type change on a Teradata field in the past, but I can't recall what the circumstances were.  I'll keep my eyes peeled for a re-occurrence and report it to you. 

    Is Currency the only data type that will inhibit query folding in Teradata?


    Friday, May 6, 2016 7:47 PM
  • I don't think we'll stop folding for currency type, we'll just treat it as a decimal type :)
    Friday, May 6, 2016 8:02 PM
    Moderator
  • Okay, but are there any other data types that will inhibit query folding on Teradata.  Earlier in this thread you indicated that data type changes won't fold.

    >We're still working on folding the type transformations, but for now it'll be better if you do that step after the other steps

    Friday, May 6, 2016 8:06 PM
  • Yes, probably. I just said that we'll still fold Currency because you thought that type would inhibit folding.
    Friday, May 6, 2016 9:00 PM
    Moderator
  • I'm interested in unhindered query folding for Teradata.  So, if there are other data types that need to be resolved please do so ASAP.
    Friday, May 6, 2016 9:24 PM