You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Scio is a thin wrapper on top of Beam offering idiomatic Scala APIs. Check out the <ahref="https://beam.apache.org/documentation/programming-guide/">Beam Programming Guide</a> first for a detailed explanation of the Beam programming model and concepts.</p>
<p>If you need custom pipeline options, subclass Beam’s <ahref="https://beam.apache.org/releases/javadoc/2.64.0/?org/apache/beam/sdk/options/PipelineOptions.html" title="org.apache.beam.sdk.options.PipelineOptions"><code>PipelineOptions</code></a> and use <code>ContextAndArgs.typed</code>:</p>
341
+
<p>If you need custom pipeline options, subclass Beam’s <ahref="https://beam.apache.org/releases/javadoc/2.66.0/?org/apache/beam/sdk/options/PipelineOptions.html" title="org.apache.beam.sdk.options.PipelineOptions"><code>PipelineOptions</code></a> and use <code>ContextAndArgs.typed</code>:</p>
<li><ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/SCollection.html#count:com.spotify.scio.values.SCollection[Long]" title="com.spotify.scio.values.SCollection"><code>count</code></a> (or <code>countByKey</code>) counts the number of elements</li>
359
359
<li><ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/SCollection.html#countByValue:com.spotify.scio.values.SCollection[(T,Long)]" title="com.spotify.scio.values.SCollection"><code>countByValue</code></a> counts the number of elements for each value in a <code>SCollection[T]</code></li>
360
-
<li><ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/SCollection.html#countApproxDistinct(estimator:com.spotify.scio.estimators.ApproxDistinctCounter[T]):com.spotify.scio.values.SCollection[Long]" title="com.spotify.scio.values.SCollection"><code>countApproxDistinct</code></a> (or <code>countApproxDistinctByKey</code>) estimates a distinct count, with Beam’s <ahref="https://beam.apache.org/releases/javadoc/2.64.0/?org/apache/beam/sdk/transforms/ApproximateUnique.html" title="org.apache.beam.sdk.transforms.ApproximateUnique"><code>ApproximateUnique</code></a> or Scio’s HyperLogLog-based <ahref="https://spotify.github.io/scio/api/com/spotify/scio/estimators/ApproxDistinctCounter.html" title="com.spotify.scio.estimators.ApproxDistinctCounter"><code>ApproxDistinctCounter</code></a></li>
360
+
<li><ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/SCollection.html#countApproxDistinct(estimator:com.spotify.scio.estimators.ApproxDistinctCounter[T]):com.spotify.scio.values.SCollection[Long]" title="com.spotify.scio.values.SCollection"><code>countApproxDistinct</code></a> (or <code>countApproxDistinctByKey</code>) estimates a distinct count, with Beam’s <ahref="https://beam.apache.org/releases/javadoc/2.66.0/?org/apache/beam/sdk/transforms/ApproximateUnique.html" title="org.apache.beam.sdk.transforms.ApproximateUnique"><code>ApproximateUnique</code></a> or Scio’s HyperLogLog-based <ahref="https://spotify.github.io/scio/api/com/spotify/scio/estimators/ApproxDistinctCounter.html" title="com.spotify.scio.estimators.ApproxDistinctCounter"><code>ApproxDistinctCounter</code></a></li>
<li><ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/SCollection.html#max(implicitord:Ordering[T]):com.spotify.scio.values.SCollection[T]" title="com.spotify.scio.values.SCollection"><code>max</code></a> (or <code>maxByKey</code>) finds the maximum element given some <ahref="http://www.scala-lang.org/api/2.13.16/scala/math/Ordering.html" title="scala.math.Ordering"><code>Ordering</code></a></li>
372
372
<li><ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/SCollection.html#min(implicitord:Ordering[T]):com.spotify.scio.values.SCollection[T]" title="com.spotify.scio.values.SCollection"><code>min</code></a> (or <code>minByKey</code>) finds the minimum element given some <ahref="http://www.scala-lang.org/api/2.13.16/scala/math/Ordering.html" title="scala.math.Ordering"><code>Ordering</code></a></li>
373
373
<li><ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/SCollection.html#mean(implicitev:Numeric[T]):com.spotify.scio.values.SCollection[Double]" title="com.spotify.scio.values.SCollection"><code>mean</code></a> finds the mean given some <ahref="http://www.scala-lang.org/api/2.13.16/scala/math/Numeric.html" title="scala.math.Numeric"><code>Numeric</code></a></li>
374
-
<li><ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/SCollection.html#quantilesApprox(numQuantiles:Int)(implicitord:Ordering[T]):com.spotify.scio.values.SCollection[Iterable[T]]" title="com.spotify.scio.values.SCollection"><code>quantilesApprox</code></a> (or <code>approxQuantilesByKey</code>) finds the distribution using Beam’s <ahref="https://beam.apache.org/releases/javadoc/2.64.0/?org/apache/beam/sdk/transforms/ApproximateQuantiles.html" title="org.apache.beam.sdk.transforms.ApproximateQuantiles"><code>ApproximateQuantiles</code></a></li>
374
+
<li><ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/SCollection.html#quantilesApprox(numQuantiles:Int)(implicitord:Ordering[T]):com.spotify.scio.values.SCollection[Iterable[T]]" title="com.spotify.scio.values.SCollection"><code>quantilesApprox</code></a> (or <code>approxQuantilesByKey</code>) finds the distribution using Beam’s <ahref="https://beam.apache.org/releases/javadoc/2.66.0/?org/apache/beam/sdk/transforms/ApproximateQuantiles.html" title="org.apache.beam.sdk.transforms.ApproximateQuantiles"><code>ApproximateQuantiles</code></a></li>
375
375
</ul>
376
376
<p>For <code>SCollection</code>s containing <code>Double</code>, Scio additionally provides a <ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/DoubleSCollectionFunctions.html#stats:com.spotify.scio.values.SCollection[com.spotify.scio.util.StatCounter]" title="com.spotify.scio.values.DoubleSCollectionFunctions"><code>stats</code></a> method that computes the count, mean, min, max, variance, standard deviation, sample variance, and sample standard deviation over the <code>SCollection</code>. Convenience methods are available directly on the <ahref="https://spotify.github.io/scio/api/com/spotify/scio/values/DoubleSCollectionFunctions.html" title="com.spotify.scio.values.DoubleSCollectionFunctions"><code>SCollection</code></a> if only a single value is required:</p>
<p><ahref="https://spotify.github.io/scio/api/com/spotify/scio/ScioResult.html" title="com.spotify.scio.ScioResult"><code>ScioResult</code></a> can be used to access metric values, individually or as a group:</p>
<li>For Scio version >= <code>0.4.0</code></li>
587
587
</ul>
588
-
<p>Starting from Scio <code>0.4.0</code> you can use Apache Beam’s <ahref="https://beam.apache.org/releases/javadoc/2.64.0/?org/apache/beam/sdk/io/FileSystems.html" title="org.apache.beam.sdk.io.FileSystems"><code>Filesystems</code></a> abstraction:</p>
588
+
<p>Starting from Scio <code>0.4.0</code> you can use Apache Beam’s <ahref="https://beam.apache.org/releases/javadoc/2.66.0/?org/apache/beam/sdk/io/FileSystems.html" title="org.apache.beam.sdk.io.FileSystems"><code>Filesystems</code></a> abstraction:</p>
<p>You can get a <ahref="https://beam.apache.org/releases/javadoc/2.64.0/?org/apache/beam/sdk/extensions/gcp/options/GcsOptions.html#getGcsUtil--" title="org.apache.beam.sdk.extensions.gcp.options.GcsOptions"><code>GcsUtil</code></a> instance from <code>ScioContext</code>, which can be used to open GCS files in read or write mode.</p>
598
+
<p>You can get a <ahref="https://beam.apache.org/releases/javadoc/2.66.0/?org/apache/beam/sdk/extensions/gcp/options/GcsOptions.html#getGcsUtil--" title="org.apache.beam.sdk.extensions.gcp.options.GcsOptions"><code>GcsUtil</code></a> instance from <code>ScioContext</code>, which can be used to open GCS files in read or write mode.</p>
<li>In <ahref="./Scio-REPL.html">Scio-REPL</a>, use <code>runAndCollect()</code> to execute the pipeline and materialize the contents of an <code>SCollection</code></li>
787
787
</ul>
788
788
<h4><ahref="#how-do-i-improve-side-input-performance-" name="how-do-i-improve-side-input-performance-" class="anchor"><spanclass="anchor-link"></span></a>How do I improve side input performance?</h4>
789
-
<p>By default, Dataflow workers allocate 100MB (see <ahref="https://beam.apache.org/releases/javadoc/2.64.0/?org/apache/beam/runners/dataflow/options/DataflowWorkerHarnessOptions.html#getWorkerCacheMb--" title="org.apache.beam.runners.dataflow.options.DataflowWorkerHarnessOptions"><code>DataflowWorkerHarnessOptions#getWorkerCacheMb</code></a>) of memory for caching side inputs, and falls back to disk or network. Therefore jobs with large side inputs may be slow. To override this default, register <code>DataflowWorkerHarnessOptions</code> before parsing command line arguments and then pass <code>--workerCacheMb=N</code> when submitting the job.</p>
789
+
<p>By default, Dataflow workers allocate 100MB (see <ahref="https://beam.apache.org/releases/javadoc/2.66.0/?org/apache/beam/runners/dataflow/options/DataflowWorkerHarnessOptions.html#getWorkerCacheMb--" title="org.apache.beam.runners.dataflow.options.DataflowWorkerHarnessOptions"><code>DataflowWorkerHarnessOptions#getWorkerCacheMb</code></a>) of memory for caching side inputs, and falls back to disk or network. Therefore jobs with large side inputs may be slow. To override this default, register <code>DataflowWorkerHarnessOptions</code> before parsing command line arguments and then pass <code>--workerCacheMb=N</code> when submitting the job.</p>
0 commit comments