LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Using Filter Node to Change Data Type

    Employee
    Posted 04-30-2015 12:08

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rebecca_robare

    Following instructions on other threads, I'm trying to change a double variable into an integer or long using a filter node (the original data from an oracle database is stored as a non-decimal number). I am using BRAINScript

    emit *
    override emit 'DIM_ORDER_KEY' as ORDERKEY.int

    but the output I am getting gives me a variable named 'ORDERKEY.int' that is a double.

    I need to change the type because I need to hash-split the data (112.5 million rows) and using a hash-split node produces an error that I can't hash-split on a double field.

    What's the best solution for this situation?

    Thanks.


  • 2.  RE: Using Filter Node to Change Data Type

    Employee
    Posted 04-30-2015 12:11

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    Hi, Rebecca! Good to see you on the forums. What you'll need to do is something like:

    emit 'DIM_ORDER_KEY'.int() as ORDERKEY

    When you specified ORDERKEY.int, it was being taken as a string, hence the ORDERKEY.int field name.

    On a side note, if you're hash-splitting, is there another field that you could use to split?


  • 3.  RE: Using Filter Node to Change Data Type

    Employee
    Posted 04-30-2015 12:50

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rebecca_robare

    You know, I went back and looked at it, and it seems to be functioning in a different way from being the primary key for that table. So I don't think I should split on it at all -- but I'm glad to know how to change the data types anyway!

    Originally posted by: ryeh
    					

    Hi, Rebecca! Good to see you on the forums. What you'll need to do is something like:

    emit 'DIM_ORDER_KEY'.int() as ORDERKEY

    When you specified ORDERKEY.int, it was being taken as a string, hence the ORDERKEY.int field name.

    On a side note, if you're hash-splitting, is there another field that you could use to split?