spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ott Toomet (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SPARK-20263) create empty dataframes in sparkR
Date Tue, 18 Apr 2017 17:52:41 GMT

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

Ott Toomet edited comment on SPARK-20263 at 4/18/17 5:52 PM:
-------------------------------------------------------------

for instance, by rbinding in a loop.  I have several pieces of code that work along the lines:
    for(file in datafiles) {
       df <- read.parquet(file);
       result <- do_something_with(df);
       final <- rbind(final, result) 
    }

Sure, one can easily add logic to check if we have initialized 'final' but it seems so much
simpler and logical just to initialize empty 'final' before the loop.  (sorry, I don't know
how to display code in comment)


was (Author: otoomet):
for instance, by rbinding in a loop.  I have several pieces of code that work along the lines:
    for(file in datafiles) {
       df <- read.parquet(file)
       result <- do_something_with(df)
       final <- rbind(final, result) 
    }

Sure, one can easily add logic to check if we have initialized 'final' but it seems so much
simpler and logical just to initialize empty 'final' before the loop.

> create empty dataframes in sparkR
> ---------------------------------
>
>                 Key: SPARK-20263
>                 URL: https://issues.apache.org/jira/browse/SPARK-20263
>             Project: Spark
>          Issue Type: Wish
>          Components: SparkR
>    Affects Versions: 2.1.0
>            Reporter: Ott Toomet
>            Priority: Minor
>
> SparkR 2.1 does not support creating empty dataframes, nor conversion of empty R dataframes
to spark ones:
> createDataFrame(data.frame(a=integer()))
> gives 
> Error in takeRDD(x, 1)[[1]] : subscript out of bounds



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message