So I had a typo of dataframe.write.mode(SaveMode.Overwrite)text(output)
missing a period between mode
and text
, but eclipse doesn't seem to complain, and when I run it through Junit and production, everything seems to run fine without exception, even producing correct output. I am confused that there wasn't any bug, and my Spark DAG does show that my code has changed, so I am more confused. Any ideas?
Asked
Active
Viewed 2,208 times
1

THIS USER NEEDS HELP
- 3,136
- 4
- 30
- 55
-
1Possible duplicate of [What are the precise rules for when you can omit parenthesis, dots, braces, = (functions), etc.?](http://stackoverflow.com/questions/1181533/what-are-the-precise-rules-for-when-you-can-omit-parenthesis-dots-braces-f) – Oct 28 '16 at 17:31
1 Answers
4
It is just the way scala works. It's the Infix notation
A white space is not required because of the parentheses. Here is a demonstration :
scala> val l = List(1,2,3)
l: List[Int] = List(1, 2, 3)
scala> l.take(1)
res4: List[Int] = List(1)
scala> l take 1
res5: List[Int] = List(1)
scala> (l)take 1
res6: List[Int] = List(1)
scala> l.take(2)take(1)
res7: List[Int] = List(1)

cheseaux
- 5,187
- 31
- 50
-
So you don't even need to have a space between two methods? I suppose it should have been at least something like write.mode(SaveMode.Overwrite) text(output) or something – THIS USER NEEDS HELP Oct 28 '16 at 17:34
-
-
Still confused because it seems like most of the use cases seem to have at least space between method names, but mine doesn't have any space between two methods. – THIS USER NEEDS HELP Oct 28 '16 at 18:22
-
1I've added a last example, but did you read the documentation I've linked to my answer ? everything is explained there – cheseaux Oct 28 '16 at 18:26