You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Brandon Williams (Created) (JIRA)" <ji...@apache.org> on 2012/02/10 17:00:59 UTC

[jira] [Created] (CASSANDRA-3886) Pig can't store some types after loading them

Pig can't store some types after loading them
---------------------------------------------

                 Key: CASSANDRA-3886
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
             Project: Cassandra
          Issue Type: Bug
          Components: Hadoop
    Affects Versions: 0.8.7
            Reporter: Brandon Williams
            Assignee: Brandon Williams
             Fix For: 1.0.8


In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3886) Pig can't store some types after loading them

Posted by "Pavel Yaskevich (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207192#comment-13207192 ] 

Pavel Yaskevich commented on CASSANDRA-3886:
--------------------------------------------

+1
                
> Pig can't store some types after loading them
> ---------------------------------------------
>
>                 Key: CASSANDRA-3886
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 0.8.7
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>             Fix For: 1.0.8
>
>         Attachments: 3886.txt
>
>
> In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-3886) Pig can't store some types after loading them

Posted by "Brandon Williams (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Williams resolved CASSANDRA-3886.
-----------------------------------------

    Resolution: Fixed

Committed w/nit fixed.
                
> Pig can't store some types after loading them
> ---------------------------------------------
>
>                 Key: CASSANDRA-3886
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 0.8.7
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>             Fix For: 1.0.8
>
>         Attachments: 3886.txt
>
>
> In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3886) Pig can't store some types after loading them

Posted by "Brandon Williams (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Williams updated CASSANDRA-3886:
----------------------------------------

    Attachment:     (was: 3886.txt)
    
> Pig can't store some types after loading them
> ---------------------------------------------
>
>                 Key: CASSANDRA-3886
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 0.8.7
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>             Fix For: 1.0.8
>
>
> In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3886) Pig can't store some types after loading them

Posted by "Pavel Yaskevich (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13205577#comment-13205577 ] 

Pavel Yaskevich commented on CASSANDRA-3886:
--------------------------------------------

I think we should make objToBB method uniform and return in each case e.g.

{noformat}
private ByteBuffer objToBB(Object o)
{
    if (o == null)
        return (ByteBuffer)o;
    if (o instanceof java.lang.String)
        return new DataByteArray((String)o);
    if (o instanceof Integer)
        return IntegerType.instance.decompose((BigInteger)o);
    if (o instanceof Long)
        return LongType.instance.decompose((Long)o);
    if (o instanceof Float)
        return FloatType.instance.decompose((Float)o);
    if (o instanceof Double)
        return DoubleType.instance.decompose((Double)o);
    if (o instanceof UUID)
        return ByteBuffer.wrap(UUIDGen.decompose((UUID) o));
    
    return null;
}
{noformat}
                
> Pig can't store some types after loading them
> ---------------------------------------------
>
>                 Key: CASSANDRA-3886
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 0.8.7
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>             Fix For: 1.0.8
>
>         Attachments: 3886.txt
>
>
> In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3886) Pig can't store some types after loading them

Posted by "Brandon Williams (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Williams updated CASSANDRA-3886:
----------------------------------------

    Attachment: 3886.txt

Patch to convert all possible types.  Includes UUID, even though setTupleValue should make it impossible for a UUID to get here, just in case.
                
> Pig can't store some types after loading them
> ---------------------------------------------
>
>                 Key: CASSANDRA-3886
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 0.8.7
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>             Fix For: 1.0.8
>
>         Attachments: 3886.txt
>
>
> In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3886) Pig can't store some types after loading them

Posted by "Pavel Yaskevich (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13205577#comment-13205577 ] 

Pavel Yaskevich edited comment on CASSANDRA-3886 at 2/10/12 5:50 PM:
---------------------------------------------------------------------

+1, with following nit: I think we should make objToBB method uniform and return in each case e.g.

{noformat}
private ByteBuffer objToBB(Object o)
{
    if (o == null)
        return (ByteBuffer)o;
    if (o instanceof java.lang.String)
        return new DataByteArray((String)o);
    if (o instanceof Integer)
        return IntegerType.instance.decompose((BigInteger)o);
    if (o instanceof Long)
        return LongType.instance.decompose((Long)o);
    if (o instanceof Float)
        return FloatType.instance.decompose((Float)o);
    if (o instanceof Double)
        return DoubleType.instance.decompose((Double)o);
    if (o instanceof UUID)
        return ByteBuffer.wrap(UUIDGen.decompose((UUID) o));
    
    return null;
}
{noformat}
                
      was (Author: xedin):
    I think we should make objToBB method uniform and return in each case e.g.

{noformat}
private ByteBuffer objToBB(Object o)
{
    if (o == null)
        return (ByteBuffer)o;
    if (o instanceof java.lang.String)
        return new DataByteArray((String)o);
    if (o instanceof Integer)
        return IntegerType.instance.decompose((BigInteger)o);
    if (o instanceof Long)
        return LongType.instance.decompose((Long)o);
    if (o instanceof Float)
        return FloatType.instance.decompose((Float)o);
    if (o instanceof Double)
        return DoubleType.instance.decompose((Double)o);
    if (o instanceof UUID)
        return ByteBuffer.wrap(UUIDGen.decompose((UUID) o));
    
    return null;
}
{noformat}
                  
> Pig can't store some types after loading them
> ---------------------------------------------
>
>                 Key: CASSANDRA-3886
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 0.8.7
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>             Fix For: 1.0.8
>
>         Attachments: 3886.txt
>
>
> In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3886) Pig can't store some types after loading them

Posted by "Brandon Williams (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Williams updated CASSANDRA-3886:
----------------------------------------

    Attachment: 3886.txt
    
> Pig can't store some types after loading them
> ---------------------------------------------
>
>                 Key: CASSANDRA-3886
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 0.8.7
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>             Fix For: 1.0.8
>
>         Attachments: 3886.txt
>
>
> In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-3886) Pig can't store some types after loading them

Posted by "Brandon Williams (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Williams resolved CASSANDRA-3886.
-----------------------------------------

    Resolution: Fixed

Committed.
                
> Pig can't store some types after loading them
> ---------------------------------------------
>
>                 Key: CASSANDRA-3886
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 0.8.7
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>             Fix For: 1.0.8
>
>         Attachments: 3886.txt
>
>
> In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (CASSANDRA-3886) Pig can't store some types after loading them

Posted by "Brandon Williams (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Williams reopened CASSANDRA-3886:
-----------------------------------------


We actually do need the catch-all:

{noformat}
return ByteBuffer.wrap(((DataByteArray) o).get());
{noformat}

To cast all the pig-native types like CharArray, but these are all guaranteed to be castable to DataByteArray.
                
> Pig can't store some types after loading them
> ---------------------------------------------
>
>                 Key: CASSANDRA-3886
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3886
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>    Affects Versions: 0.8.7
>            Reporter: Brandon Williams
>            Assignee: Brandon Williams
>             Fix For: 1.0.8
>
>         Attachments: 3886.txt
>
>
> In CASSANDRA-2810, we removed the decompose methods in putNext instead relying on objToBB, however it cannot sufficiently handle all types.  For instance, if longs are loaded and then an attempt to store them is made, this causes a cast exception: java.io.IOException: java.io.IOException: java.lang.ClassCastException: java.lang.Long cannot be cast to org.apache.pig.data.DataByteArray Output must be (key, {(column,value)...}) for ColumnFamily or (key, {supercolumn:{(column,value)...}...}) for SuperColumnFamily

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira