Constructor
new SQLContext(SparkContext)
Parameters:
Name | Type | Description |
---|---|---|
SparkContext |
module:eclairjs.SparkContext |
- Since:
- EclairJS 0.1 Spark 1.0.0
- Source:
Methods
createDataFrame(rowRDD, schema) → {module:eclairjs/sql.DataFrame}
Creates a DataFrame from RDD of Rows using the schema
Parameters:
Name | Type | Description |
---|---|---|
rowRDD |
Array.<module:eclairjs/rdd.RDD> | - |
schema |
module:eclairjs/sql/types.StructType | - |
- Source:
Returns:
createDataFrameFromJson(schema) → {module:eclairjs/sql.DataFrame}
Creates a DataFrame from RDD of JSON
Parameters:
Name | Type | Description |
---|---|---|
{{module:eclairjs.RDD |
RDD of JSON | |
schema |
object | object with keys corresponding to JSON field names (or getter functions), and values indicating Datatype |
- Source:
Returns:
Example
var df = sqlContext.createDataFrame([{id:1,"name":"jim"},{id:2,"name":"tom"}], {"id":"Integer","name","String"});
read() → {module:eclairjs/sql.DataFrameReader}
Returns DataFrameReader
- Source:
Returns:
sql(sqlString) → {module:eclairjs/sql.DataFrame}
Returns DataFrame
Parameters:
Name | Type | Description |
---|---|---|
sqlString |
string |
- Source:
Returns:
table(tableName) → {module:eclairjs/sql.DataFrame}
Returns the specified table as a DataFrame.
Parameters:
Name | Type | Description |
---|---|---|
tableName |
string |
- Source: