Comments conventions in Spark distribution official examples

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Comments conventions in Spark distribution official examples

Fuad Efendi
Hello,


I am trying to guess what such comments needed  for and cannot google it on Internet, maybe some documentation tool? Both, Java and Scala, have this in import statements and in a code: “$example on” and “$example off"

package org.apache.spark.examples.sql

// $example on:programmatic_schema$
import org.apache.spark.sql.Row
// $example off:programmatic_schema$
// $example on:init_session$
import org.apache.spark.sql.SparkSession
// $example off:init_session$
// $example on:programmatic_schema$
// $example on:data_types$
import org.apache.spark.sql.types._
// $example off:data_types$
// $example off:programmatic_schema$

object SparkSQLExample {

  // $example on:create_ds$
  case class Person(name: String, age: Long)
  // $example off:create_ds$
...



Thanks,




--

Machine Learning, Data Mining, Recommender Systems, Search

Reply | Threaded
Open this post in threaded view
|

Re: Comments conventions in Spark distribution official examples

srowen
These only matter to our documentation, which includes the source of
these examples inline in the docs. For brevity, the examples don't
need to show all the imports that are otherwise necessary for the
source file. You can ignore them like the compiler does as comments if
you are using the example directly. has no effect on the Spark
functionality.

On Wed, Aug 5, 2020 at 7:26 PM Fuad Efendi <[hidden email]> wrote:

>
> Hello,
>
>
> I am trying to guess what such comments needed  for and cannot google it on Internet, maybe some documentation tool? Both, Java and Scala, have this in import statements and in a code: “$example on” and “$example off"
>
> package org.apache.spark.examples.sql
>
> // $example on:programmatic_schema$
> import org.apache.spark.sql.Row
> // $example off:programmatic_schema$
> // $example on:init_session$
> import org.apache.spark.sql.SparkSession
> // $example off:init_session$
> // $example on:programmatic_schema$
> // $example on:data_types$
> import org.apache.spark.sql.types._
> // $example off:data_types$
> // $example off:programmatic_schema$
>
> object SparkSQLExample {
>
>   // $example on:create_ds$
>   case class Person(name: String, age: Long)
>   // $example off:create_ds$
> ...
>
>
>
> Thanks,
>
>
>
>
> --
>
> Fuad Efendi
>
> (416) 993-2060
>
> http://www.tokenizer.ca
>
> Machine Learning, Data Mining, Recommender Systems, Search
>

---------------------------------------------------------------------
To unsubscribe e-mail: [hidden email]