You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by Jeff Zhang <zj...@gmail.com> on 2015/11/05 03:30:51 UTC

Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?

Not sure the reason,  it seems LibSVMRelation and CsvRelation can extends
HadoopFsRelation and leverage the features from HadoopFsRelation.  Any
other consideration for that ?


-- 
Best Regards

Jeff Zhang

Re: Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?

Posted by Sasaki Kai <le...@me.com>.
Great, thank you!

> On Nov 11, 2015, at 11:41 AM, Jeff Zhang <zj...@gmail.com> wrote:
> 
> Yes Kai, I also to plan to do for CsvRelation, will create PR for spark-csv
> 
> On Wed, Nov 11, 2015 at 9:10 AM, Sasaki Kai <lewuathe@me.com <ma...@me.com>> wrote:
> Did you indicate CsvRelation in spark-csv package? LibSVMRelation is included in spark core package, but CsvRelation(spark-csv) is not.
> Is it necessary for us to modify also spark-csv as you proposed in SPARK-11622?
> 
> Regards
> 
> Kai
> 
> > On Nov 5, 2015, at 11:30 AM, Jeff Zhang <zjffdu@gmail.com <ma...@gmail.com>> wrote:
> >
> >
> > Not sure the reason,  it seems LibSVMRelation and CsvRelation can extends HadoopFsRelation and leverage the features from HadoopFsRelation.  Any other consideration for that ?
> >
> >
> > --
> > Best Regards
> >
> > Jeff Zhang
> 
> 
> 
> 
> -- 
> Best Regards
> 
> Jeff Zhang


Re: Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?

Posted by Jeff Zhang <zj...@gmail.com>.
Yes Kai, I also to plan to do for CsvRelation, will create PR for spark-csv

On Wed, Nov 11, 2015 at 9:10 AM, Sasaki Kai <le...@me.com> wrote:

> Did you indicate CsvRelation in spark-csv package? LibSVMRelation is
> included in spark core package, but CsvRelation(spark-csv) is not.
> Is it necessary for us to modify also spark-csv as you proposed in
> SPARK-11622?
>
> Regards
>
> Kai
>
> > On Nov 5, 2015, at 11:30 AM, Jeff Zhang <zj...@gmail.com> wrote:
> >
> >
> > Not sure the reason,  it seems LibSVMRelation and CsvRelation can
> extends HadoopFsRelation and leverage the features from HadoopFsRelation.
> Any other consideration for that ?
> >
> >
> > --
> > Best Regards
> >
> > Jeff Zhang
>
>


-- 
Best Regards

Jeff Zhang

Re: Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?

Posted by Sasaki Kai <le...@me.com>.
Did you indicate CsvRelation in spark-csv package? LibSVMRelation is included in spark core package, but CsvRelation(spark-csv) is not.
Is it necessary for us to modify also spark-csv as you proposed in SPARK-11622?

Regards

Kai 

> On Nov 5, 2015, at 11:30 AM, Jeff Zhang <zj...@gmail.com> wrote:
> 
> 
> Not sure the reason,  it seems LibSVMRelation and CsvRelation can extends HadoopFsRelation and leverage the features from HadoopFsRelation.  Any other consideration for that ?
> 
> 
> -- 
> Best Regards
> 
> Jeff Zhang


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


RE: Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?

Posted by "Cheng, Hao" <ha...@intel.com>.
I think you’re right, we do offer the opportunity for developers to make mistakes while implementing the new Data Source.

Here we assume that the new relation MUST NOT extends more than one trait of the CatalystScan, TableScan, PrunedScan, PrunedFilteredScan , etc. otherwise it will causes problem as you described, probably we can add additional checking / reporting rule for the abuse.


From: Jeff Zhang [mailto:zjffdu@gmail.com]
Sent: Thursday, November 5, 2015 1:55 PM
To: Cheng, Hao
Cc: dev@spark.apache.org
Subject: Re: Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?

Thanks Hao. I have ready made it extends HadoopFsRelation and it works. Will create a jira for that.

Besides that, I noticed that in DataSourceStrategy, spark build physical plan based on the trait of the BaseRelation in pattern matching (e.g. CatalystScan, TableScan, HadoopFsRelation). That means the order matters. I think it is risky because that means one BaseRelation can't extends more than 2 of these traits. And seems there's no place to restrict to extends more than 2 traits. Maybe needs to clean and reorganize these traits otherwise user may meets some weird issue when developing new DataSource.



On Thu, Nov 5, 2015 at 1:16 PM, Cheng, Hao <ha...@intel.com>> wrote:
Probably 2 reasons:

1.      HadoopFsRelation was introduced since 1.4, but seems CsvRelation was created based on 1.3

2.      HadoopFsRelation introduces the concept of Partition, which probably not necessary for LibSVMRelation.

But I think it will be easy to change as extending from HadoopFsRelation.

Hao

From: Jeff Zhang [mailto:zjffdu@gmail.com<ma...@gmail.com>]
Sent: Thursday, November 5, 2015 10:31 AM
To: dev@spark.apache.org<ma...@spark.apache.org>
Subject: Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?


Not sure the reason,  it seems LibSVMRelation and CsvRelation can extends HadoopFsRelation and leverage the features from HadoopFsRelation.  Any other consideration for that ?


--
Best Regards

Jeff Zhang



--
Best Regards

Jeff Zhang

Re: Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?

Posted by Jeff Zhang <zj...@gmail.com>.
Thanks Hao. I have ready made it extends HadoopFsRelation and it works.
Will create a jira for that.

Besides that, I noticed that in DataSourceStrategy, spark build physical
plan based on the trait of the BaseRelation in pattern matching (e.g.
CatalystScan, TableScan, HadoopFsRelation). That means the order matters. I
think it is risky because that means one BaseRelation can't extends more
than 2 of these traits. And seems there's no place to restrict to extends
more than 2 traits. Maybe needs to clean and reorganize these traits
otherwise user may meets some weird issue when developing new DataSource.



On Thu, Nov 5, 2015 at 1:16 PM, Cheng, Hao <ha...@intel.com> wrote:

> Probably 2 reasons:
>
> 1.      HadoopFsRelation was introduced since 1.4, but seems CsvRelation
> was created based on 1.3
>
> 2.      HadoopFsRelation introduces the concept of Partition, which
> probably not necessary for LibSVMRelation.
>
>
>
> But I think it will be easy to change as extending from HadoopFsRelation.
>
>
>
> Hao
>
>
>
> *From:* Jeff Zhang [mailto:zjffdu@gmail.com]
> *Sent:* Thursday, November 5, 2015 10:31 AM
> *To:* dev@spark.apache.org
> *Subject:* Why LibSVMRelation and CsvRelation don't extends
> HadoopFsRelation ?
>
>
>
>
>
> Not sure the reason,  it seems LibSVMRelation and CsvRelation can extends
> HadoopFsRelation and leverage the features from HadoopFsRelation.  Any
> other consideration for that ?
>
>
>
>
>
> --
>
> Best Regards
>
> Jeff Zhang
>



-- 
Best Regards

Jeff Zhang

RE: Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?

Posted by "Cheng, Hao" <ha...@intel.com>.
Probably 2 reasons:

1.      HadoopFsRelation was introduced since 1.4, but seems CsvRelation was created based on 1.3

2.      HadoopFsRelation introduces the concept of Partition, which probably not necessary for LibSVMRelation.

But I think it will be easy to change as extending from HadoopFsRelation.

Hao

From: Jeff Zhang [mailto:zjffdu@gmail.com]
Sent: Thursday, November 5, 2015 10:31 AM
To: dev@spark.apache.org
Subject: Why LibSVMRelation and CsvRelation don't extends HadoopFsRelation ?


Not sure the reason,  it seems LibSVMRelation and CsvRelation can extends HadoopFsRelation and leverage the features from HadoopFsRelation.  Any other consideration for that ?


--
Best Regards

Jeff Zhang