[ 
https://issues.apache.org/jira/browse/METAMODEL-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13826521#comment-13826521
 ] 

Kasper Sørensen commented on METAMODEL-30:
------------------------------------------

I have attached my proposed patch for the issue.

Please raise any concerns, VOTE or else we'll push based on lazy concensus.

> CsvDataContext.executeCountQuery breaks if Resource.getSize() returns -1
> ------------------------------------------------------------------------
>
>                 Key: METAMODEL-30
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-30
>             Project: Metamodel
>          Issue Type: Bug
>            Reporter: Kasper Sørensen
>            Assignee: Kasper Sørensen
>         Attachments: METAMODEL-30.patch
>
>
> On line 282 of CsvDataContext we check the size of the CSV resource 
> (typically file) like this:
> final long length = _resource.getSize();
> But the Resource interface says that a resource may return -1 to this method, 
> if the size is not determinable.
> In that case our code breaks since there will eventually be a negative sample 
> data array created from this value.
> Rather we should check for the exceptional -1 value and handle the sample 
> array size accordingly.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to