Re: enum-like types in Spark

2015-07-02 Thread Imran Rashid
Hi Stephen, I'm not sure which link you are referring to for the example code -- but yes, the recommendation is that you create the enum in Java, eg. see https://github.com/apache/spark/blob/v1.4.0/core/src/main/java/org/apache/spark/status/api/v1/StageStatus.java Then nothing special is

Re: enum-like types in Spark

2015-07-01 Thread Stephen Boesch
I am reviving an old thread here. The link for the example code for the java enum based solution is now dead: would someone please post an updated link showing the proper interop? Specifically: it is my understanding that java enum's may not be created within Scala. So is the proposed solution

Re: enum-like types in Spark

2015-04-09 Thread Imran Rashid
any update here? This is relevant for a currently open PR of mine -- I've got a bunch of new public constants defined w/ format #4, but I'd gladly switch to java enums. (Even if we are just going to postpone this decision, I'm still inclined to switch to java enums ...) just to be clear about

Re: enum-like types in Spark

2015-03-23 Thread Sean Owen
Yeah the fully realized #4, which gets back the ability to use it in switch statements (? in Scala but not Java?) does end up being kind of huge. I confess I'm swayed a bit back to Java enums, seeing what it involves. The hashCode() issue can be 'solved' with the hash of the String

Re: enum-like types in Spark

2015-03-23 Thread Reynold Xin
If scaladoc can show the Java enum types, I do think the best way is then just Java enum types. On Mon, Mar 23, 2015 at 2:11 PM, Patrick Wendell pwend...@gmail.com wrote: If the official solution from the Scala community is to use Java enums, then it seems strange they aren't generated in

Re: enum-like types in Spark

2015-03-23 Thread Imran Rashid
well, perhaps I overstated things a little, I wouldn't call it the official solution, just a recommendation in the never-ending debate (and the recommendation from folks with their hands on scala itself). Even if we do get this fixed in scaladoc eventually -- as its not in the current versions,

Re: enum-like types in Spark

2015-03-23 Thread Aaron Davidson
The only issue I knew of with Java enums was that it does not appear in the Scala documentation. On Mon, Mar 23, 2015 at 1:46 PM, Sean Owen so...@cloudera.com wrote: Yeah the fully realized #4, which gets back the ability to use it in switch statements (? in Scala but not Java?) does end up

Re: enum-like types in Spark

2015-03-23 Thread Patrick Wendell
If the official solution from the Scala community is to use Java enums, then it seems strange they aren't generated in scaldoc? Maybe we can just fix that w/ Typesafe's help and then we can use them. On Mon, Mar 23, 2015 at 1:46 PM, Sean Owen so...@cloudera.com wrote: Yeah the fully realized #4,

Re: enum-like types in Spark

2015-03-17 Thread Xiangrui Meng
Xiangrui Meng men...@gmail.com: Hi all, There are many places where we use enum-like types in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an official approach for enum-like types in Spark. 1. Scala's Enumeration (e.g

Re: enum-like types in Spark

2015-03-16 Thread Patrick Wendell
a constant (similar to Java'sstatic final members): 1. object Container { 2. val MyConstant = ... 3. } 2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com: Hi all, There are many places where we use enum-like types in Spark, but in different ways. Every

Re: enum-like types in Spark

2015-03-16 Thread Aaron Davidson
in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an official approach for enum-like types in Spark. 1. Scala's Enumeration (e.g., SchedulingMode, WorkerState, etc) * All types show up as Enumeration.Value in Java. http

Re: enum-like types in Spark

2015-03-16 Thread Xiangrui Meng
Container { 2. val MyConstant = ... 3. } 2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com : Hi all, There are many places where we use enum-like types in Spark, but in different ways. Every approach has

Re: enum-like types in Spark

2015-03-11 Thread RJ Nowling
): 1. object Container { 2. val MyConstant = ... 3. } 2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com : Hi all, There are many places where we use enum-like types in Spark

Re: enum-like types in Spark

2015-03-09 Thread Imran Rashid
:11 GMT-08:00 Xiangrui Meng men...@gmail.com: Hi all, There are many places where we use enum-like types in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an official approach for enum-like types

Re: enum-like types in Spark

2015-03-06 Thread Sean Owen
, There are many places where we use enum-like types in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an official approach for enum-like types in Spark. 1. Scala's Enumeration (e.g., SchedulingMode, WorkerState, etc

Re: enum-like types in Spark

2015-03-05 Thread Patrick Wendell
types in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an official approach for enum-like types in Spark. 1. Scala's Enumeration (e.g., SchedulingMode, WorkerState, etc) * All types show up

Re: enum-like types in Spark

2015-03-05 Thread Mridul Muralidharan
places where we use enum-like types in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an official approach for enum-like types in Spark. 1. Scala's Enumeration (e.g., SchedulingMode, WorkerState, etc) * All types

Re: enum-like types in Spark

2015-03-05 Thread Mridul Muralidharan
in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an official approach for enum-like types in Spark. 1. Scala's Enumeration (e.g., SchedulingMode, WorkerState, etc) * All types show up as Enumeration.Value

Re: enum-like types in Spark

2015-03-04 Thread Michael Armbrust
to Java’sstatic final members): 1. object Container { 2. val MyConstant = ... 3. } 2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com: Hi all, There are many places where we use enum-like types in Spark, but in different ways. Every approach has both

enum-like types in Spark

2015-03-04 Thread Xiangrui Meng
Hi all, There are many places where we use enum-like types in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an “official” approach for enum-like types in Spark. 1. Scala’s Enumeration (e.g., SchedulingMode, WorkerState, etc) * All types

Re: enum-like types in Spark

2015-03-04 Thread Joseph Bradley
Xiangrui Meng men...@gmail.com: Hi all, There are many places where we use enum-like types in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an “official” approach for enum-like types in Spark. 1. Scala’s Enumeration (e.g

Re: enum-like types in Spark

2015-03-04 Thread Aaron Davidson
-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com: Hi all, There are many places where we use enum-like types in Spark, but in different ways. Every approach has both pros and cons. I wonder whether there should be an “official” approach for enum-like types in Spark

Re: enum-like types in Spark

2015-03-04 Thread Stephen Boesch
be considered a constant (similar to Java’sstatic final members): 1. object Container { 2. val MyConstant = ... 3. } 2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com: Hi all, There are many places where we use enum-like types in Spark, but in different ways. Every approach has

Re: enum-like types in Spark

2015-03-04 Thread Patrick Wendell
a constant (similar to Java'sstatic final members): 1. object Container { 2. val MyConstant = ... 3. } 2015-03-04 17:11 GMT-08:00 Xiangrui Meng men...@gmail.com: Hi all, There are many places where we use enum-like types in Spark