Package org.apache.calcite.adapter.spark
Class SparkRuntime
java.lang.Object
org.apache.calcite.adapter.spark.SparkRuntime
Runtime utilities for Calcite's Spark adapter. Generated code calls these
methods.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Combines linq4jFunction
and SparkFlatMapFunction
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Enumerable<T>
asEnumerable
(org.apache.spark.api.java.JavaRDD<T> rdd) Converts an RDD into an enumerable.static <T> org.apache.spark.api.java.JavaRDD<T>
createRdd
(org.apache.spark.api.java.JavaSparkContext sc, Enumerable<T> enumerable) Converts an enumerable into an RDD.static <T> org.apache.spark.api.java.JavaRDD<T>
createRdd
(org.apache.spark.api.java.JavaSparkContext sc, T[] ts) Converts an array into an RDD.static org.apache.spark.api.java.JavaSparkContext
getSparkContext
(DataContext root) Returns the Spark context for the current execution.
-
Method Details
-
createRdd
public static <T> org.apache.spark.api.java.JavaRDD<T> createRdd(org.apache.spark.api.java.JavaSparkContext sc, T[] ts) Converts an array into an RDD. -
createRdd
public static <T> org.apache.spark.api.java.JavaRDD<T> createRdd(org.apache.spark.api.java.JavaSparkContext sc, Enumerable<T> enumerable) Converts an enumerable into an RDD. -
asEnumerable
Converts an RDD into an enumerable. -
getSparkContext
Returns the Spark context for the current execution.Currently a global variable; maybe later held within
root
.
-