@@ -64,15 +64,15 @@ private[spark] case class DataFrameReaderFunctions(@transient dfr: DataFrameRead
64
64
* @return DataFrame
65
65
*/
66
66
def cosmosDB [T <: Product : TypeTag ](readConfig : Config ): DataFrame =
67
- createCosmosDBDataFrame(InferSchema .reflectSchema[T ](), Some (readConfig), None )
67
+ createCosmosDBDataFrame(InferSchema .reflectSchema[T ](), Option (readConfig), None )
68
68
69
69
/**
70
70
* Creates a [[DataFrame ]] with the set schema
71
71
*
72
72
* @param schema the schema definition
73
73
* @return DataFrame
74
74
*/
75
- def cosmosDB (schema : StructType ): DataFrame = createCosmosDBDataFrame(Some (schema), None , None )
75
+ def cosmosDB (schema : StructType ): DataFrame = createCosmosDBDataFrame(Option (schema), None , None )
76
76
77
77
/**
78
78
* Creates a [[DataFrame ]] with the set schema
@@ -81,7 +81,7 @@ private[spark] case class DataFrameReaderFunctions(@transient dfr: DataFrameRead
81
81
* @param readConfig any custom read configuration
82
82
* @return DataFrame
83
83
*/
84
- def cosmosDB (schema : StructType , readConfig : Config , sqlContext : SQLContext ): DataFrame = createCosmosDBDataFrame(Some (schema), Some (readConfig), Some (sqlContext))
84
+ def cosmosDB (schema : StructType , readConfig : Config , sqlContext : SQLContext ): DataFrame = createCosmosDBDataFrame(Option (schema), Option (readConfig), Option (sqlContext))
85
85
86
86
private def createDataFrame (schema : Option [StructType ], readConfig : Option [Config ], sqlContext : Option [SQLContext ]): DataFrame = {
87
87
var cachingMode : CachingMode = CachingMode .NONE
@@ -135,12 +135,12 @@ private[spark] case class DataFrameReaderFunctions(@transient dfr: DataFrameRead
135
135
.- (CosmosDBConfig .RollingChangeFeed )
136
136
.- (CosmosDBConfig .CachingModeParam )
137
137
.+ ((CosmosDBConfig .CachingModeParam , CachingMode .CACHE .toString)))
138
- val df = createDataFrame(schema, Some (dfConfig), sqlContext)
138
+ val df = createDataFrame(schema, Option (dfConfig), sqlContext)
139
139
140
140
val changeFeedConfig = Config (dfConfig.asOptions
141
141
.+ ((CosmosDBConfig .ReadChangeFeed , " true" ))
142
142
.- (CosmosDBConfig .CachingModeParam ))
143
- val changeFeedDf = createDataFrame(schema, Some (changeFeedConfig), sqlContext)
143
+ val changeFeedDf = createDataFrame(schema, Option (changeFeedConfig), sqlContext)
144
144
145
145
df.union(changeFeedDf)
146
146
} else {
0 commit comments