Hitachi Vantara Pentaho Community Forums
Results 1 to 1 of 1

Thread: Cassandra Input - Data Type

  1. #1

    Question Cassandra Input - Data Type

    Hi guys!
    I need some hints about Cassandra Input step in Pentaho Data Integration.
    Let me explain what I've done so far.

    ----------------QUERY on CASSANDRA CLIENT--------------------------------
    I need to take the value from a column family called "Messages", and i'm interested in column1 and value.

    For example, we consider two sample lines:
    column1="1:asset" value="0x30303a45303a43373a30393a33363a3635" - [valuetipe:HEX] contains a String.
    column1="2:metric:Float:temperatureExhaust" value="0x41f00000" - [valuetipe:HEX] contains a float.
    (ultimately I will need to encode this information as a string or a float or other types, depending on the need)

    ----------------QUERY on CASSANDRA INPUT (PENTAHO)----------------
    Now, i've tried to reproduce the same query on Cassandra input step in Pentaho Data Integration (QueryMessages.jpg)
    and, reading the result, seems that Pentaho deserializing everything as a String.
    We consider the two sample lines:

    First line
    column1="1:asset" and value="0x30303a45303a43373a30393a33363a3635"
    correctly decoded as "00:E0:C7:09:36:65" which is the correct string contained in the field.
    In this case there are no problem because in the end i need a String.

    Second line
    column1="2:metric:Float:temperatureExhaust" value="0x41f00000"
    Pethaho try to translate from HEX to TEXT, and this generate some problem, because return "A�".

    What i try to do
    (just for the row which have this structured type)
    is to set a Calculator node for coming back to the HEX notation, the same shown in the Cassandra client.

    for example
    the row in Cassandra
    column1="2:metric:Float:temperatureExhaust" value="0x41f00000" (HEX)
    in Pentaho become
    column1="2:metric:Float:temperatureExhaust" value="A�" (HEX->TEXT)
    and using a Calculator the result is
    column1="2:metric:Float:temperatureExhaust" value="41FD" (TEXT->HEX)

    Now, value="41FD" could be, in such way, related to value="0x41f00000"?
    there may be a way to get back to the original information from here?

    the ideal solution for me is to use a different deserialization in function of the type indicated in column1.
    Is there a way to implement this kind of solution?

    If any of you can give me some hints or provide documentation about this topic I'll be grateful !

    Last edited by bouncingRain; 07-31-2014 at 07:07 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.